@@ -10,10 +10,13 @@ $exists
10
10
11
11
:operator:`$exists` selects the documents that contain the field if
12
12
``<boolean>`` is ``true``. If ``<boolean>`` is ``false``, the query
13
- only returns the documents that do not contain the field. Documents
14
- that contain the value ``null`` are returned if one checks that field :operator:`$exists`
15
- and are not returned when using "$exists: ``false``" (since ``null``
16
- is a valid value).
13
+ only returns the documents that do not contain the
14
+ field.
15
+
16
+ When you specify ``true`` to the :operator:`$exist` operator, the
17
+ query will select documents where the value of the specified field
18
+ is ``null``. If you specify ``false`` to :operator:`$exist`, the
19
+ query will **not** match fields that hold the ``null`` value.
17
20
18
21
MongoDB `$exists` does **not** correspond to SQL operator
19
22
``exists``. For SQL ``exists``, refer to the :operator:`$in`
@@ -29,14 +32,6 @@ $exists
29
32
where the ``qty`` field exists *and* its value does not equal either
30
33
``5`` nor ``15``.
31
34
32
- .. seealso::
33
-
34
- - :method:`~db.collection.find()`
35
-
36
- - :operator:`$nin`
37
-
38
- - :operator:`$and`
39
-
40
- - :operator:`$in`
41
-
42
- - :ref:`faq-developers-query-for-nulls`
35
+ .. seealso:: :method:`~db.collection.find()`, :operator:`$nin`,
36
+ :operator:`$and`, :operator:`$in`, and
37
+ :ref:`faq-developers-query-for-nulls`.
0 commit comments