@@ -16,7 +16,7 @@ $uniqueDocs
16
16
The :operator:`$uniqueDocs` operator inverts the default behavior
17
17
of the :operator:`$within` operator. By default, the
18
18
:operator:`$within` operator returns the document only once. If you
19
- specify a value of ``false`` for :operator:`uniqueDocs`, MongoDB
19
+ specify a value of ``false`` for :operator:`$ uniqueDocs`, MongoDB
20
20
will return multiple instances of a single document.
21
21
22
22
.. example::
@@ -25,21 +25,21 @@ $uniqueDocs
25
25
26
26
.. code-block:: javascript
27
27
28
- { addresses: [ { name: "Home", loc:[55.5,42.3]}, {name:"Work",loc:[32.3,44.2]}] }
28
+ { addresses: [ { name: "Home", loc: [55.5, 42.3] }, { name: "Work", loc: [32.3, 44.2] } ] }
29
29
30
30
The following query would return the same document multiple
31
31
times:
32
32
33
33
.. code-block:: javascript
34
34
35
- db.addressBook.find( {"addresses.loc":{ "$within": {"$box": [ [0,0],[100,100] ], $uniqueDocs:false } }}).pretty( )
35
+ db.addressBook.find( { "addresses.loc": { "$within": { "$box": [ [0,0], [100,100] ], $uniqueDocs: false } } } )
36
36
37
37
The following query would return each matching document, only
38
38
once:
39
39
40
40
.. code-block:: javascript
41
41
42
- db.addressBook.find( {"address.loc":{ "$within": {"$box": [ [0,0],[100,100] ], $uniqueDocs:true } }}).pretty( )
42
+ db.addressBook.find( { "address.loc": { "$within": { "$box": [ [0,0], [100,100] ], $uniqueDocs: true } } } )
43
43
44
44
You cannot specify :operator:`$uniqueDocs` with :operator:`$near`
45
45
or haystack queries.
0 commit comments