Doctrine\MongoDB\Query\Expr::unsetField PHP Method

unsetField() public method

The field will be removed from the document (not set to null).
See also: Builder::unsetField()
See also: http://docs.mongodb.org/manual/reference/operator/unset/
public unsetField ( )
    public function unsetField()
    {
        $this->requiresCurrentField();
        $this->newObj['$unset'][$this->currentField] = 1;
        return $this;
    }

Usage Example

Example #1
0
 /**
  * Unset the current field.
  *
  * The field will be removed from the document (not set to null).
  *
  * @see Expr::unsetField()
  * @see http://docs.mongodb.org/manual/reference/operator/unset/
  * @return self
  */
 public function unsetField()
 {
     $this->expr->unsetField();
     return $this;
 }