Complete the code to find all documents in the collection.
db.collection.[1]()The find() method retrieves all documents from a MongoDB collection.
Complete the code to insert a new document into the collection.
db.collection.[1]({ name: 'Alice', age: 30 })
The insertOne() method adds a single new document to the collection.
Fix the error in the query to find documents where age is greater than 25.
db.collection.find({ age: { [1]: 25 } })The $gt operator means 'greater than' in MongoDB queries.
Fill both blanks to update the age of a user named 'Bob' to 35.
db.collection.updateOne({ name: 'Bob' }, { [1]: { age: [2] } })The $set operator updates the specified field to a new value, here setting age to 35.
Fill both blanks to delete all documents where age is less than 20.
db.collection.deleteMany({ age: { [1]: [2] } })The deleteMany() method removes all documents matching the query. The $lt operator means 'less than', so this deletes documents where age is less than 20.