Skip to content
Justice Tech School

$exists and $type

Check field presence and type.

Example
db.users.find({ email: { $exists: true } })
db.users.find({ age: { $type: "number" } })

Exercise

Field present.

{ $: true }

Quiz Test

What does $exists check?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.