Skip to content

Commit 3dc2078

Browse files
authored
DOCSP-26745 clarify sortby limitation (#6816)
* DOCSP-26745 clarify sortby limitation * DOCSP-26745 clarify sortby limitation
1 parent d647739 commit 3dc2078

File tree

1 file changed

+6
-4
lines changed
  • source/reference/operator/aggregation

1 file changed

+6
-4
lines changed

source/reference/operator/aggregation/rank.txt

+6-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ Returns the document position (known as the rank) relative to other
2121
documents in the :pipeline:`$setWindowFields` stage :ref:`partition
2222
<setWindowFields-partitionBy>`.
2323

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>`.
2830

2931
If multiple documents occupy the same rank, :group:`$rank` places
3032
the document with the subsequent value at a rank with a gap

0 commit comments

Comments
 (0)