Complete the code to remove all documents from the 'users' collection without deleting the collection itself.
db.users.[1]({})The deleteMany({}) command deletes all documents in the collection but keeps the collection itself.
Complete the code to completely remove the 'orders' collection from the database.
db.orders.[1]()The drop() method deletes the entire collection and its indexes.
Fix the error in the code that tries to delete all documents but accidentally deletes the collection.
db.products.[1]({})Using drop() deletes the collection. To delete all documents but keep the collection, use deleteMany({}).
Fill both blanks to delete all documents from 'logs' collection but keep the collection.
db.logs.[1]([2])
deleteMany({}) deletes all documents because the empty filter matches all documents.
Fill all three blanks to drop the 'sessions' collection and then check if it exists.
db.sessions.[1](); const exists = db.getCollectionNames().[2](name => name === [3]);
drop() removes the collection. Then some() checks if 'sessions' is still in the list of collections.