Skip to content

Commit 51195ac

Browse files
committed
Update source/reference/operators.txt
Added a note on how to search for MinKey - already added to wiki
1 parent 9f29fe7 commit 51195ac

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

source/reference/operators.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,16 @@ Element
479479

480480
``MinKey`` and ``MaxKey`` compare less than and greater than all
481481
other possible :term:`BSON` element values, respectively, and exist
482-
primarily for internal use.
482+
primarily for internal use.
483+
484+
.. note::
485+
486+
Searching for ``MaxKey`` by type will work as expected, however
487+
to search for ``MinKey`` you must use -1, for example:
488+
489+
.. code-block:: javascript
490+
491+
db.collection.find( { field: { $type: -1 } } );
483492

484493
.. note::
485494

0 commit comments

Comments
 (0)