Complete the code to find documents where the array 'tags' contains the value 'mongodb'.
db.collection.find({ tags: [1] })To find documents where the array 'tags' contains 'mongodb', you directly match the value with the field name.
Complete the code to find documents where the 'scores' array contains the number 85.
db.collection.find({ scores: [1] })To find documents where the array contains the number 85, you can directly match the number without quotes.
Fix the error in the query to find documents where the 'items' array contains the string 'book'.
db.collection.find({ items: [1] })The value 'book' must be a string in quotes to match array elements correctly.
Fill both blanks to find documents where the 'ratings' array contains a value greater than 4.
db.collection.find({ ratings: { [1]: [2] } })Use the $gt operator with the value 4 to find array elements greater than 4.
Fill all three blanks to find documents where the 'comments' array contains an element with 'author' equal to 'Alice' and 'likes' greater than 10.
db.collection.find({ comments: { [1]: { [2]: "Alice", [3]: 10 } } })Use $elemMatch to match array elements with multiple conditions: author equals 'Alice' and likes greater than 10.