I would have expected the following two queries to be identical. Apparently, $exists requires an explicit "true". By analogy with the usual query syntax, I would have expected $exits: 1 to be the same as $exists: true, but it appears not to be. I'm not sure if this is a bug, but it certainly does violate the principle of least astonishment.
> db.users.find({is_dup_of: {$exists: true}}).count()
225
> db.users.find({is_dup_of: {$exists: 1}}).count()
304849
- is duplicated by
-
SERVER-2093 $exists : X
- Closed