Complete the code to specify the data source for Atlas Data Federation.
db.[1].find()Atlas Data Federation uses a federated collection name to query data across multiple sources.
Complete the code to filter documents where the field 'status' equals 'active' in Atlas Data Federation.
db.federatedCollection.find({ 'status': [1] })In MongoDB queries, string values must be enclosed in quotes. Single or double quotes are acceptable in JavaScript, but in JSON-like query objects, single quotes are not valid JSON. However, in MongoDB shell, single quotes are acceptable. Therefore, 'active' is the correct choice here.
Fix the error in the aggregation pipeline to group documents by 'category' in Atlas Data Federation.
db.federatedCollection.aggregate([ { $group: { _id: [1], count: { $sum: 1 } } } ])The _id field in $group stage must use the field path "$category" to group documents by the category field.
Fill both blanks to project only 'name' and 'email' fields in the Atlas Data Federation query.
db.federatedCollection.find({}, { [1]: 1, [2]: 1 })Projection specifies which fields to include by setting them to 1 in the second argument of find().
Fill all three blanks to sort the federated data by 'createdAt' descending and limit results to 5.
db.federatedCollection.find().sort({ [1]: [2] }).limit([3])Sorting by 'createdAt' descending uses -1, and limit specifies how many documents to return.