Complete the code to find all documents in the 'users' collection.
db.users.[1]()In MongoDB, find() is used to get all documents from a collection.
Complete the code to insert a new document into the 'products' collection.
db.products.[1]({ name: 'Book', price: 9.99 })
insertOne() adds a single document to a MongoDB collection.
Fix the error in the code to update the price of a product named 'Pen' to 1.5.
db.products.updateOne({ name: 'Pen' }, { [1]: { price: 1.5 } })MongoDB uses $set to update specific fields in a document.
Fill both blanks to delete all documents where the 'status' is 'inactive' in the 'accounts' collection.
db.accounts.[1]([2]: 'inactive')
deleteMany() removes all documents matching the filter. The field to filter is 'status'.
Fill all three blanks to find documents in 'orders' where 'quantity' is greater than 10 and sort by 'date' descending.
db.orders.find({ [1]: { [2]: 10 } }).sort({ [3]: -1 })Use quantity as the field, $gt for 'greater than', and sort by date descending with -1.