MongoDB 8 · Create, read, update, delete

Find with a filter and projection

Find users older than 30 and return only their names.

db.users.find({ age: { $gt: 30 } }, { name: 1, _id: 0 })

Official MongoDB 8 documentation

More create, read, update, delete commands

All create, read, update, delete commands · MongoDB 8 cheatsheet

Was this page helpful?