Element and Type Operators
$exists tests whether a field is present and $type checks its BSON type. Use them to clean messy data.
Example
db.students.find({ phone: { $exists: false } })
db.students.find({ age: { $type: "string" } })Exercise
Missing field.
{ phone: { $: false } }
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.