Skip to content

Commit 3b56f7e

Browse files
committed
Update source/core/indexes.txt
Added index caveats wrt $or
1 parent 0f84e9c commit 3b56f7e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

source/core/indexes.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,3 +796,14 @@ Be aware of the following behaviors and limitations:
796796

797797
- Create indexes to support queries and other operations, but do not
798798
maintain indexes that your MongoDB instance cannot or will not use.
799+
800+
- When using indexes with :operator:`$or` queries, remember that
801+
each clause of an :operator:`$or` query will execute in parallel.
802+
These clauses can each use their own index.
803+
804+
- When using the :operator:`$or` operator with the
805+
:method:`sort() <cursor.sort()>` method in a query, the query will
806+
**not** use the indexes on the :operator:`$or` fields.
807+
808+
- You cannot use the :operator:`$or` with ``2d`` :doc:`geospatial
809+
queries </core/geospatial-indexes>`.

0 commit comments

Comments
 (0)