Doctrine\MongoDB\Query\Expr::inc PHP Метод

inc() публичный Метод

If the field does not exist, it will be set to this value.
См. также: Builder::inc()
См. также: http://docs.mongodb.org/manual/reference/operator/inc/
public inc ( float | integer $value )
$value float | integer
    public function inc($value)
    {
        $this->requiresCurrentField();
        $this->newObj['$inc'][$this->currentField] = $value;
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * Increment the current field.
  *
  * If the field does not exist, it will be set to this value.
  *
  * @see Expr::inc()
  * @see http://docs.mongodb.org/manual/reference/operator/inc/
  * @param float|integer $value
  * @return self
  */
 public function inc($value)
 {
     $this->expr->inc($value);
     return $this;
 }