Skip to content

Commit 4b2d4aa

Browse files
author
Andrew Leung
committed
adding in: for internal usage minkey is -1.
1 parent 8583816 commit 4b2d4aa

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

source/reference/operators.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,8 @@ Element
480480
.. note::
481481

482482
Query statements cannot use :operator:`$type` to test arrays
483-
(i.e. ``4``.) Instead use an operation with the
484-
:operator:`$where` that resembles the following:
483+
(i.e. ``4``.) Instead, use the :operator:`$where` operator that
484+
resembles the following:
485485

486486
.. code-block:: javascript
487487

@@ -490,6 +490,15 @@ Element
490490
See the :issue:`SERVER-1475` for more information about the
491491
array type.
492492

493+
For internal usage, such as querying for the minimum value of a
494+
shard key, the ``$minkey`` value is ``-1``. One would use the
495+
following code to find the minimum :term:`shard key` of a
496+
:term:`shard cluster`.
497+
498+
.. code-block:: javascript
499+
500+
db.chunks.find( { "min.shardKey": { $type: -1 } } )
501+
493502
.. operator:: $regex
494503

495504
The :operator:`$regex` operator provides regular expression

0 commit comments

Comments
 (0)