diff --git a/source/reference/operator/aggregation/sort.txt b/source/reference/operator/aggregation/sort.txt index ba0cdcd72e5..bcf983a8b8c 100644 --- a/source/reference/operator/aggregation/sort.txt +++ b/source/reference/operator/aggregation/sort.txt @@ -117,8 +117,11 @@ option in :method:`db.collection.aggregate()` method and the :pipeline:`$sort` operator can take advantage of an index when placed at the **beginning** of the pipeline or placed **before** -the following aggregation operators: :pipeline:`$project`, -:pipeline:`$unwind`, and :pipeline:`$group`. - +the :pipeline:`$project`, +:pipeline:`$unwind`, and :pipeline:`$group` aggregation operators. +If :pipeline:`$project`, :pipeline:`$unwind`, or :pipeline:`$group` +occur prior to the :pipeline:`$sort` operation, :pipeline:`$sort` +cannot use any indexes. + .. todo:: if a sort precedes the first $group in a sharded system, all documents must go to the mongos for sorting.