update or insert facts for given node name

 @param node [String] node name
 @param facts [Hash] facts for the node
555941
def node_update(node, facts)
      logger.debug "  updating #{node}"
      connection[nodes_collection].find(_id: node).replace_one(facts,
        upsert: true,
        bypass_document_validation: true,
        check_keys: false,
        validating_keys: false)
    rescue ::Mongo::Error::OperationFailure => e
      logger.warn "  updating #{node} failed with: #{e.message}"
      # mongodb doesn't support keys with a dot
      # see https://docs.mongodb.com/manual/reference/limits/#Restrictions-on-Field-Names
      # as a dirty workaround we delete the document and insert it ;-)
      # The dotted field .. in .. is not valid for storage. (57)
      # .. is an illegal key in MongoDB. Keys may not start with '$' or contain a '.'.
      # (BSON::String::IllegalKey)
      raise e unless e.message =~ /The dotted field / || e.message =~ /is an illegal key/
      logger.warn "    we transform the dots into underline characters"
      begin
        facts = Hash[facts.map { |k, v| [k.tr('.', '_'), v] }]
        connection[nodes_collection].find(_id: node).replace_one(facts,
          upsert: true,
          bypass_document_validation: true,
          check_keys: false,
          validating_keys: false)
      rescue
        logger.error "  inserting node #{node} failed again with: #{e.message}"
      end
    end
1013555
def remove_fact(self, fact_id):
        """"""
        self.start_transaction()
        fact = self.__get_fact(fact_id)
        if fact:
            self.__remove_fact(fact_id)
            self.facts_changed()
        self.end_transaction()
932224
def _update_parsed_node_info(self, parsed_node, config):
        
        # Special macro defined in the global project. Use the root project's
        # definition, not the current package
        schema_override = config.config.get('schema')
        get_schema = self.get_schema_func()
        parsed_node.schema = get_schema(schema_override).strip()

        alias_override = config.config.get('alias')
        get_alias = self.get_alias_func()
        parsed_node.alias = get_alias(parsed_node, alias_override).strip()

        parsed_node.database = config.config.get(
            'database', self.default_database
        ).strip()

        # Set tags on node provided in config blocks
        model_tags = config.config.get('tags', [])
        parsed_node.tags.extend(model_tags)

        # Overwrite node config
        config_dict = parsed_node.get('config', {})
        config_dict.update(config.config)
        parsed_node.config = config_dict

        for hook_type in dbt.hooks.ModelHookType.Both:
            parsed_node.config[hook_type] = dbt.hooks.get_hooks(parsed_node,
                                                                hook_type)
131013
def apply(self, node):
        
        new_node = self.run(node)
        return self.update, new_node
925672
def push(node)
      node = Node(node)
      @head ||= node

      if @tail
        @tail.next = node
        node.prev = @tail
      end

      @tail = node

      @length += 1
      self
    end
342064
def add(self, fact):
        """"""
        token = Token.valid(fact)
        MATCHER.debug("<BusNode> added %r", token)
        for child in self.children:
            child.callback(token)
571651
def add(node)
      if @nodes.key?(node.key)
        raise DuplicateNodeError.new(node.key)
      end

      @nodes[node.key] = node
    end
32294
function updateNode(node, callback) {
  syncDb.update(node._id, node, (err, result) => {
    if(err) return callback(err);

    callback(null, node);
  });
}
260039
def set_info(self, key, value, append=True):
        
        if append:
            if key not in self.info:
                self.info[key] = []
            self.info[key].append(value)
        else:
            self.info[key] = value
740431
def new_fact(self):
        """"""
        fact = lib.EnvCreateFact(self._env, self._tpl)
        if fact == ffi.NULL:
            raise CLIPSError(self._env)

        return new_fact(self._env, fact)
1295052
private UpdateResult insert(V item, Node node) {
        UpdateResult result;
        if (node == null) {
            // This is the right location for the item, but there's no node. Create one.
            result = new UpdateResult();
            result.node = new Node(item);
            this.size++;
            this.modCount++;
        } else {
            long itemKey = item.key();
            long nodeKey = node.item.key();
            if (itemKey < nodeKey) {
                // New item is smaller than the current node's item; move to the left child.
                result = insert(item, node.left);
                node.left = result.node;
            } else if (itemKey > nodeKey) {
                // New item is larger than the current node's item; move to the right child.
                result = insert(item, node.right);
                node.right = result.node;
            } else {
                // Node already exists. Save the existing node's item and return it.
                result = new UpdateResult();
                result.updatedItem = node.item;
                node.item = item;
            }

            // Rebalance the sub-tree, if necessary.
            result.node = balance(node);
        }

        return result;
    }
399230
def node_insert_after(self, node, new_node):
        """"""

        assert(not self.node_is_on_list(new_node))
        assert(node is not new_node)

        next = self.node_next(node)
        assert(next is not None)
        self.node_set_next(node, new_node)
        self.node_set_prev(new_node, node)

        self.node_set_next(new_node, next)
        self.node_set_prev(next, new_node)
1132180
def update_node(self, node, diff=None):
        """"""
        return self.manager.update_node(node, diff=diff)
704717
def facts(self):
        """"""
        fact = lib.EnvGetNextFact(self._env, ffi.NULL)

        while fact != ffi.NULL:
            yield new_fact(self._env, fact)

            fact = lib.EnvGetNextFact(self._env, fact)
723646
function(facts) {
        var ttl = '', fact,
            that = this;
        for (var i = 0; i < facts.length; i++) {
            fact = facts[i];
            ttl += that.factToTurtle(fact);
        }
        return ttl;
    }
106955
function updateNode(node, content, append) {
  append = append || false;

  while(!append && node.firstChild) {
    node.removeChild(node.firstChild);
  }

  if(content instanceof Element) {
    node.appendChild(content);
  }
  else if(content instanceof Array) {
    content.forEach(function(element) {
      node.appendChild(element);
    });
  }
  else {
    node.textContent = content;
  }
}
175139
def update_and_delete_storage(node, key, value)
      old_node = node.dup
      new_node = update_node(node, key, value)
      delete_node_storage(old_node) if old_node != new_node
      new_node
    end