Complete the code to create a multikey index on the 'tags' array field.
db.articles.createIndex({ tags: [1] })To create a multikey index on an array field, use 1 for ascending order on the array field.
Complete the code to find documents where the 'tags' array contains 'mongodb'.
db.articles.find({ tags: [1] })To find documents where an array contains a specific value, you can directly query with the value.
Fix the error in the index creation code to correctly create a multikey index on 'comments.author'.
db.posts.createIndex({ [1]: 1 })To create a multikey index on a field inside an array of subdocuments, use the dot notation 'comments.author'.
Fill both blanks to create a compound multikey index on 'tags' and 'comments.author'.
db.posts.createIndex({ [1]: 1, [2]: 1 })Compound multikey indexes can be created on multiple array fields using their correct field names.
Fill all three blanks to create a multikey index on 'categories', 'tags', and 'comments.author'.
db.blog.createIndex({ [1]: 1, [2]: 1, [3]: 1 })To index multiple array fields, list each with 1 for ascending order using their full field names.