Complete the code to insert a document with a string field named 'name'.
db.users.insertOne({ name: [1] })The 'name' field should be a string, so it must be enclosed in quotes.
Complete the code to find documents where the 'age' field is a number equal to 30.
db.users.find({ age: [1] })The 'age' field is a number, so the value should be a number without quotes.
Fix the error in the query to find users with a string 'status' equal to 'active'.
db.users.find({ status: [1] })String values must be enclosed in quotes in MongoDB queries.
Fill both blanks to create a document with a string 'title' and a number 'pages'.
db.books.insertOne({ title: [1], pages: [2] })The 'title' is a string and must be quoted. The 'pages' is a number and should not be quoted.
Fill all three blanks to find documents where 'author' is a string, 'year' is a number greater than 2000, and 'available' is a boolean true.
db.books.find({ author: [1], year: { $gt: [2] }, available: [3] })The 'author' is a string and needs quotes. The 'year' is a number and should be without quotes. The 'available' is a boolean true.