Complete the code to delete one document where the name is 'Alice'.
db.collection('users').deleteOne({ name: [1] })
The deleteOne method requires a filter object. The value for the name field must be a string, so it needs quotes like 'Alice'.
Complete the code to delete one document where the age is 30.
db.collection('users').deleteOne({ age: [1] })
The age field is a number, so the value should be the number 30 without quotes.
Fix the error in the code to delete one document where the status is 'active'.
db.collection('users').deleteOne({ status: [1] })
The value 'active' must be a string with quotes. Without quotes, it is treated as a variable which causes an error.
Fill both blanks to delete one document where the city is 'Paris' and the age is 25.
db.collection('users').deleteOne({ [1]: [2], age: 25 })
The filter object needs the field name city without quotes as a key, and the value 'Paris' as a string with quotes.
Fill all three blanks to delete one document where the first name is 'John', last name is 'Doe', and active status is true.
db.collection('users').deleteOne({ firstName: [1], lastName: [2], active: [3] })
String values like 'John' and 'Doe' need quotes. Boolean values like true are unquoted keywords.