src/League/Monga/Query/Update.php
public function set($field, $value = null)
    {
        if (! is_array($field)) {
            $field = [$field => $value];
        }

        foreach ($field as $f => $v) {
            $this->update('$set', $f, $v);
        }

        return $this;
    }
public function set($field, $value = null)
    {
        if (! is_array($field)) {
            $field = [$field => $value];
        }

        foreach ($field as $f => $v) {
            $this->update('$set', $f, $v);
        }

        return $this;
    }
public function set ( $ field , $ value = null ) { if ( ! is_array ( $ field ) ) { $ field = [ $ field => $ value ] ; } foreach ( $ field as $ f => $ v ) { $ this -> update ( '$set' , $ f , $ v ) ; } return $ this ; }
Update the field from a document.

@param string $field field name
@param string $value new value

@return object $this
Update the field from a document .