File tree 1 file changed +6
-4
lines changed
source/reference/operator/aggregation
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,12 @@ Returns the document position (known as the rank) relative to other
21
21
documents in the :pipeline:`$setWindowFields` stage :ref:`partition
22
22
<setWindowFields-partitionBy>`.
23
23
24
- The :pipeline:`$setWindowFields` stage :ref:`sortBy
25
- <setWindowFields-sortBy>` field value determines the document rank. For
26
- more information on how MongoDB compares fields with different types,
27
- see :ref:`BSON comparison order <bson-types-comparison-order>`.
24
+ The :ref:`sortBy <setWindowFields-sortBy>` field value in the
25
+ :pipeline:`$setWindowFields` stage determines the document rank. When
26
+ used with the ``$rank`` operator, ``sortBy`` can only take one field as
27
+ its value. For more information on how MongoDB compares fields with
28
+ different types, see :ref:`BSON comparison order
29
+ <bson-types-comparison-order>`.
28
30
29
31
If multiple documents occupy the same rank, :group:`$rank` places
30
32
the document with the subsequent value at a rank with a gap
You can’t perform that action at this time.
0 commit comments