@@ 997-1006 (lines=10) @@ | ||
994 | * @param mixed|Expr $valueOrExpression |
|
995 | * @return $this |
|
996 | */ |
|
997 | public function pull($valueOrExpression) |
|
998 | { |
|
999 | if ($valueOrExpression instanceof Expr) { |
|
1000 | $valueOrExpression = $valueOrExpression->getQuery(); |
|
1001 | } |
|
1002 | ||
1003 | $this->requiresCurrentField(); |
|
1004 | $this->newObj['$pull'][$this->currentField] = $valueOrExpression; |
|
1005 | return $this; |
|
1006 | } |
|
1007 | ||
1008 | /** |
|
1009 | * Remove all elements matching any of the given values from the current |
|
@@ 1043-1055 (lines=13) @@ | ||
1040 | * @param mixed|Expr $valueOrExpression |
|
1041 | * @return $this |
|
1042 | */ |
|
1043 | public function push($valueOrExpression) |
|
1044 | { |
|
1045 | if ($valueOrExpression instanceof Expr) { |
|
1046 | $valueOrExpression = array_merge( |
|
1047 | ['$each' => []], |
|
1048 | $valueOrExpression->getQuery() |
|
1049 | ); |
|
1050 | } |
|
1051 | ||
1052 | $this->requiresCurrentField(); |
|
1053 | $this->newObj['$push'][$this->currentField] = $valueOrExpression; |
|
1054 | return $this; |
|
1055 | } |
|
1056 | ||
1057 | /** |
|
1058 | * Specify $gte and $lt criteria for the current field. |
|
@@ 154-163 (lines=10) @@ | ||
151 | * @param mixed|Expr $valueOrExpression |
|
152 | * @return $this |
|
153 | */ |
|
154 | public function addToSet($valueOrExpression) |
|
155 | { |
|
156 | if ($valueOrExpression instanceof Expr) { |
|
157 | $valueOrExpression = $valueOrExpression->getQuery(); |
|
158 | } |
|
159 | ||
160 | $this->requiresCurrentField(); |
|
161 | $this->newObj['$addToSet'][$this->currentField] = $valueOrExpression; |
|
162 | return $this; |
|
163 | } |
|
164 | ||
165 | /** |
|
166 | * Specify $all criteria for the current field. |