<pre>
{ $foreach : { field: { q }, $update: u } }
</pre>
337911
public static Update forEach(String field,
                                 UpdateQuery q,
                                 ForEachUpdate u) {
        Update x = new Update(false);
        ObjectNode fe = JsonNodeFactory.instance.objectNode();
        fe.set(field, q.toJson());
        fe.set("$update", u.toJson());
        ((ObjectNode) x.node).set("$foreach", fe);
        return x;
    }
575495
function ($ul, collection, updater, refresh) {
            var json = _(collection.models).map(function (m) {
                var ret = _.clone(m.attributes);
                _.extend(ret, { id: m.id, cid: m.cid });
                return ret;
            });
            this.updateJSON($ul, json, updater, refresh);
        }
283058
protected function getFieldsToUpdate()
    {
        $toUpdate = array();

        $fields     = $this->_item->getFields();
        $origFields = $this->_item->getOrigFields();
        foreach ($fields as $field => $value) {
            if (! array_key_exists($field, $origFields) or $value != $origFields[$field]) {
                $toUpdate[$field] = $value;
            }
        }

        return $toUpdate;
    }
341843
public function set($field, $value = UNDEFINED)
    {
        if ($value === false) {
            throw $this->exception('Value "false" is not supported by SQL')
                ->addMoreInfo('field', $field);
        }
        if (is_array($field)) {
            foreach ($field as $key => $value) {
                $this->set($key, $value);
            }

            return $this;
        }

        if ($value === UNDEFINED) {
            throw $this->exception('Specify value when calling set()');
        }

        $this->args['set'][$field] = $value;

        return $this;
    }
839071
function update( $key, $val = false ) {
			if ( ! is_array( $key ) ) {
				$key = array( $key => $val );
			}

			$is_updated = false;

			foreach ( $key as $k => $v ) {
				if ( $this->{$k} === $v ) {
					continue;
				}

				if ( ( is_string( $this->{$k} ) && is_numeric( $v ) ||
				       ( is_numeric( $this->{$k} ) && is_string( $v ) ) ) &&
				     $this->{$k} == $v
				) {
					continue;
				}

				// Update value.
				$this->{$k} = $v;

				$is_updated = true;
			}

			$this->_is_updated = $is_updated;

			return $is_updated;
		}
1248308
function updatehex(){
  var hex = hexinputfield;
  if(hexinputvalue != hex){
    updateall(hexinputtobin(hex));
    clearallinputs();
    hexinputfield = hex;
    hexinputvalue = hex;
  }
}
564090
function forEachValue (obj, fn) {
  Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
}
572143
function(values, sendUpdatedEvt) {
		if(!values) {
         return;
      }
      var i, n=this.inputs.length;
	   for (i = 0 ; i < n ; i++) {
	      this.inputs[i].setValue(values[i], false);
      }
      
      this.runFieldsInteractions();
      
	   if(sendUpdatedEvt !== false) {
	      // fire update event
         this.fireUpdatedEvt();
      }
	}
514878
@Override
    public boolean updateValuesForField(String currentValue) {
        boolean bUpdated = false;
        FieldDefinition fieldDef = m_tableDef.getFieldDef(m_fieldName);
        if (fieldDef == null || !fieldDef.isCollection()) {
            bUpdated = updateSVScalar(currentValue);
        } else {
            bUpdated = updateMVScalar(currentValue);
        }
        return bUpdated;
    }
373989
function(fields, data) {
    if (!_.isString(fields)) {
      return data;
    }

    // If a field is specified as `foo.bar` or `foo.bar.baz`,
    // Convert it to just `foo`
    var map = {};
    _.forEach(fields.split(','), function(field) {
      map[field.split('.')[0]] = 1;
    });

    var keys = _.keys(map);
    if (_.isArray(data)) {
      data = _.map(data, function(object) {
        return _.pick(object, keys);
      });
    } else if (_.isObject(data)) {
      data = _.pick(data, keys);
    }

    return data;
  }
728542
def update_field(self, name, value):
        
        kwargs = {}
        kwargs['field.' + name] = value
        return self.post(**kwargs)
648502
protected function _buildUpdate()
        {
            $query = [];
            $query[] = "UPDATE {$this->_quoteIdentifier($this->_table_name)} SET";

            $field_list = [];

            foreach ($this->_dirty_fields as $key => $value) {
                if(!Arrays::exists($key, $this->_expr_fields)) {
                    $value = '?';
                }

                $field_list[] = "{$this->_quoteIdentifier($key)} = $value";
            }

            $query[] = join(", ", $field_list);
            $this->_addIdColumnConditions($query);

            return join(" ", $query);
        }
102138
function create_new_field_keys( &$field )
	{
		// update key
		$field['key'] = 'field_' . uniqid();
		
		
		if( isset($field['sub_fields']) && is_array($field['sub_fields']) )
		{
			foreach( $field['sub_fields'] as $f )
			{
				$this->create_new_field_keys( $f );
			}
		}
		elseif( isset($field['layouts']) && is_array($field['layouts']) )
		{
			foreach( $field['layouts'] as $layout )
			{
				if( isset($layout['sub_fields']) && is_array($layout['sub_fields']) )
				{
					foreach( $layout['sub_fields'] as $f )
					{
						$this->create_new_field_keys( $f );
					}
				}
				
			}
		}
	}
625042
function processNested (data, reqStack) {
  const updateWith = {}
  for (const key in data) {
    const val = data[key]

    if (val instanceof Array) {
      updateWith[key] = processArray(val, reqStack)
      continue
    }

    if (val instanceof Object) {
      updateWith[key] = schemaForm(val, reqStack, key)
      continue
    }
  }
  return updateWith
}
1284159
function QueryUpdate(data)
{
	//Initialize the set
	var set = '';
	
	//Get all data
	for(var key in data)
	{
		//Save data value
		var value = data[key];
		
		//Check the data type
		if(typeof value === 'string' || value instanceof String)
		{
			//Add the quotes
			value = '"' + value + '"';
		}
		
		//Check if is necessary add the comma
		if(set !== '')
		{
			//Add the comma
			set = set + ' , ';
		}
		
		//Add the key=value
		set = set + key + '=' + value;
	}
	
	//Return
	return set;
}
944369
function update($data,$param=[]) {
        if (empty($data)) return false;
        $setFields = '';
        $params = [];
        if (is_array($data)) {
            $comma = '';
            foreach ($data as $key => $value) {
                //add database real string
                if (is_array($value)) {
                    $setFields .= "{$comma} `{$key}`=" . current($value);
                }
                else {
                    $params[] = $value;
                    $setFields .= "{$comma} `{$key}`=?";
                }
                $comma = ',';
            }
        }
        else {
            $params = is_array($param)?$param:[$param];
            $setFields = $data;
        }
        $sql = "UPDATE `{$this->table}` set {$setFields}";
        if($this->where) {
            $sql .= ' '.$this->where;
            $params = array_merge($params,$this->params);
            //$params = array_merge($params, $this->autoarr($condition[1]));
        }
        $sql = str_replace('table.',$this->table.'.',$sql);
        $this->_reset();
        return $this->execute($sql, $params, false);
    }
136759
function update_field() {
        global $DB;

        $DB->update_record('data_fields', $this->field);

        // Trigger an event for updating this field.
        $event = \mod_data\event\field_updated::create(array(
            'objectid' => $this->field->id,
            'context' => $this->context,
            'other' => array(
                'fieldname' => $this->field->name,
                'dataid' => $this->data->id
            )
        ));
        $event->trigger();

        return true;
    }