Question 31
$group stage can be used multiple times within an aggregation pipeline.
Question 32
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": "James Bond", "imdb.rating": { "$gt": 8} } ).sort( { "imdb.rating": 1 } )
db.movies.find( { "title": "James Bond", "imdb.rating": { "$gt": 8} } ).sort( { "imdb.rating": 1 } )
Question 33
There is a gamers collection in your database with the following document structure: { _id: 1, level: 15, is_active: true }, { _id: 2, level: 14, is_active: true }, { _id: 3, level: 7, is_active: false } How do you increase the value of the level field by 20 for a player with id = 3?
Expected result:
{ _id: 1, level: 15, is_active: true }, { _id: 2, level: 14, is_active: true }, { _id: 3, level: 27, is_active: false }
Expected result:
{ _id: 1, level: 15, is_active: true }, { _id: 2, level: 14, is_active: true }, { _id: 3, level: 27, is_active: false }
Question 34
Is MongoDB a NoSQL database?
Question 35
Where is the MongoDB configuration file usually located?
