almost 10 years ago
MongoDB - $exist and $type operator
$type operator : It matches values based on their BSON type.
e.g. We want to fetch documents from the collection which contains the value of "city" is only null.
Above query return city with null value.
$exist operator : It matches whether the particular field exist or not in collection.
e.g. We want to fetch documents from the collection which does not contain the "city" column.
Above query return records which have not city column.
0 Comment(s)