Suppose you want to join two collections in the same database. What aggregation stage do you need to use?
Select all true statements about reconfiguring a replica set with rs.reconfig().
You have the following index in a movies collection: { "title": 1, "imdb.rating": -1, "imdb.votes": -1, "type": 1 } Can the following query use the given index for both filtering and sorting?
db.movies.find( { "title": { "$lt": "M" } } ).sort( { "imdb.votes": -1 } )
How to create a new user with the root role named root_user with password root123?
Suppose you have an accounts collection in your database. Only the following documents are stored in this collection: { _id: ObjectId("61af47c6e29861661d063714"), account_id: 1010, type: 'investment', limit: 2000000 }, { _id: ObjectId("61af47c6e29861661d063715"), account_id: 4336, type: 'derivatives', limit: 100000 }, { _id: ObjectId("61af47c6e29861661d063716"), account_id: 4336, type: 'commodity', limit: 1000 }, { _id: ObjectId("61af47c6e29861661d067825"), account_id: 7355, type: 'commodity', limit: 500000 }, { _id: ObjectId("61b1bde1ceb6f770f56b0cd9"), account_id: 4915, type: 'investment', limit: 2000000 } How many documents will be returned in response to the following aggregation pipeline? [{ $group: { _id: "$type", number_of_accounts: { $sum: 1 } }}, { $match: { number_of_accounts: { $gt: 1 } }}]