@@ 425-431 (lines=7) @@ | ||
422 | * @param string|array|null $expression Optional. A replacement expression that |
|
423 | * resolves to a document. |
|
424 | */ |
|
425 | public function replaceRoot($expression = null) : Stage\ReplaceRoot |
|
426 | { |
|
427 | $stage = new Stage\ReplaceRoot($this, $this->dm, $this->class, $expression); |
|
428 | $this->addStage($stage); |
|
429 | ||
430 | return $stage; |
|
431 | } |
|
432 | ||
433 | /** |
|
434 | * Randomly selects the specified number of documents from its input. |
|
@@ 488-494 (lines=7) @@ | ||
485 | * |
|
486 | * @see http://docs.mongodb.org/manual/reference/operator/aggregation/sortByCount/ |
|
487 | */ |
|
488 | public function sortByCount(string $expression) : Stage\SortByCount |
|
489 | { |
|
490 | $stage = new Stage\SortByCount($this, $expression, $this->dm, $this->class); |
|
491 | $this->addStage($stage); |
|
492 | ||
493 | return $stage; |
|
494 | } |
|
495 | ||
496 | /** |
|
497 | * Deconstructs an array field from the input documents to output a document |