diff --git a/source/faq/developers.txt b/source/faq/developers.txt index e2c51fc3942..e4b723f0650 100644 --- a/source/faq/developers.txt +++ b/source/faq/developers.txt @@ -514,6 +514,22 @@ Different query operators treat ``null`` values differently: { "_id" : 2 } +Note that the value of a field may also be ``undefined``, which is different from ``null`` +(though the shell renders them both as ``null``). + +- You can find ``undefined`` values by BSON type: + + .. code-block:: javascript + + db.test.find( { cancelDate : { $type : 6 } } ) + +- Alternatively, you can find ``undefined`` values using ``$in``: + + .. code-block:: javascript + + db.test.find( { cancelDate : { $in : [ undefined ] } } ) + + .. seealso:: The reference documentation for the :operator:`$type` and :operator:`$exists` operators.