MongoDB Element Query Operators

I have been working through the M001: MongoDB Basics course on MongoDB University. Here are some notes on Element Query Operators and my MongoDB Shell and Compass examples.

Descriptions from MongoDB documentation.

Name Description
$exists Matches documents that have the specified field.
$type Selects documents if a field is of the specified type.

Shell Examples

 

Compass Examples

$exists

$type

Leave a Reply

Your email address will not be published. Required fields are marked *