The delete method must be called with parentheses: delete().
Step 2: Identify impact of missing parentheses
Without parentheses, the method is not executed, so the document is not deleted.
Final Answer:
Missing parentheses after delete method call -> Option A
Quick Check:
Call delete() with () to execute [OK]
Hint: Always use parentheses to call delete() method [OK]
Common Mistakes:
Forgetting () after delete
Assuming delete is a property, not a method
Ignoring promise handling
5. You want to delete multiple documents with IDs ['doc1', 'doc2', 'doc3'] from the 'users' collection. Which approach correctly deletes all documents and logs 'All deleted' after completion?
uses Promise.all() with delete promises to wait for all deletions concurrently before logging. B calls invalid delete() on collection. C uses await loop without async function, causing syntax error. D logs without waiting for completion.
Final Answer:
Use Promise.all with delete promises -> Option A
Quick Check:
Promise.all waits for all deletes before logging [OK]
Hint: Use Promise.all to wait for all deletes before logging [OK]
Common Mistakes:
Trying to delete entire collection directly
Not waiting for all deletes before logging
Using forEach without async/await or Promise.all
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.