LMongo\Query\Builder::renameField PHP Méthode

renameField() public méthode

Renames a field.
public renameField ( mixed $old, mixed $new = null ) : integer
$old mixed
$new mixed
Résultat integer
    public function renameField($old, $new = null)
    {
        if (is_array($old)) {
            $update = array('$rename' => $old);
        } else {
            $update = array('$rename' => array($old => $new));
        }
        return $this->performUpdate($update);
    }
Builder