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: 25 })
The insertOne() method adds a single new document to the collection.
Fix the error in the code to update a document's age.
db.collection.updateOne({ name: 'Alice' }, { [1]: { age: 26 } })The $set operator updates the value of a field in a document.
Fill both blanks to delete a document where age is 30.
db.collection.[1]([2]: 30)
The deleteOne() method removes one document matching the filter. The filter uses the field age with value 30.
Fill all three blanks to find documents where age is greater than 20.
db.collection.find({ [1]: { [2]: [3] } })This query finds documents where the age field is greater than ($gt) 20.
