Complete the code to find documents where the field name starts with 'user_'.
db.collection.find({ [1]: { $exists: true } })The query uses a regular expression to match field names starting with 'user_'. The correct syntax is to use a regex pattern like /^user_/.
Complete the code to find documents where the field name starts with 'data_'.
db.collection.find({ [1]: { $exists: true } })The query uses a regular expression to match field names starting with 'data_'. The correct syntax is to use a regex pattern like /^data_/.
Fix the error in the query to find documents with any field starting with 'attr_'.
db.collection.find({ [1]: { $exists: true } })The query needs to use a regular expression to match any field name starting with 'attr_'. Using /^attr_/ as the key in the query is the correct approach.
Fill both blanks to create a query that finds documents where any field starting with 'meta_' has the value 'active'.
db.collection.find({ [1]: [2] })The query uses a regex /^meta_/ to match field names starting with 'meta_' and checks if their value is 'active'.
Fill all three blanks to create an aggregation pipeline that filters documents where the 'info_score' field has a numeric value greater than 10, and projects that field.
db.collection.aggregate([{ $match: { [1]: { $gt: [2] } } }, { $project: { [3]: 1 } }])The aggregation matches documents where 'info_score' is greater than 10 and projects the 'info_score' field.