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

not() public method

Negates an expression for the current field.
See also: Builder::not()
See also: http://docs.mongodb.org/manual/reference/operator/not/
public not ( array | Expr $expression )
$expression array | Expr
    public function not($expression)
    {
        return $this->operator('$not', $expression instanceof Expr ? $expression->getQuery() : $expression);
    }

Usage Example

示例#1
0
 /**
  * Negates an expression for the current field.
  *
  * You can create a new expression using the {@link Builder::expr()} method.
  *
  * @see Expr::not()
  * @see http://docs.mongodb.org/manual/reference/operator/not/
  * @param array|Expr $expression
  * @return self
  */
 public function not($expression)
 {
     $this->expr->not($expression);
     return $this;
 }