Reputation: 11301
I want to $match
only the empty objects in my aggregate()
. Is it possible? I know of $exists
, but {}
's boolean value is true
, so I'm stuck.
Upvotes: 2
Views: 3891
Reputation: 1199
Have you tried to just use {field: {}}
?
For example:
db.users.aggregate([{$match: {val: {}}}])
Upvotes: 6