MongoDB & NoSQL (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What are the basic MongoDB CRUD operations?
junior LevelDatabases & SQL
In Simple Words:
- Create:
db.collection.insertOne({ ... })orinsertMany([ ... ]) - Read:
db.collection.find({ status: "active" })orfindOne({ _id: ... }) - Update:
db.collection.updateOne({ _id: ... }, { $set: { status: "shipped" } })orupdateMany() - Delete:
db.collection.deleteOne({ _id: ... })ordeleteMany({ ... })