Question 1
Given a companies collection where each document has the following structure:
{ _id: ObjectId('61a8b90c6d5ce6a7d8fef95e'), name: 'Facebook', tag_list: ['facebook', 'college', 'students', 'network'], description: 'Social network' }
Which of the following commands will add new fields to the updated documents?
Question 2
Suppose you have a developers collection with only two documents:
{ _id: 1, lname: 'Smith', tech_stack: [ 'sql', 'git', 'python', 'django' ], fname: 'Bob' }, { _id: 2, fname: 'Michael', lname: 'Doe', tech_stack: [ 'git', 'python', 'sqlite', 'linux', 'flask' ] }
Using Aggregation Framework you run the following stage:
{ $unwind: { path: '$tech_stack' } }
How many documents will you have in the pipeline after the $unwind stage?
Question 3
We have the following indexes: { name: 1, founded_year: 1 } { tag_list: 1, is_active: 1 } And the following documents: { _id: ObjectId("52cdef7c4bab8bd675297daa"), name: "Sparter", founded_year: 2007, tag_list: ["gaming", "game", "wow"], is_active: true }, { _id: ObjectId("52cdef7c4bab8bd675297da3"), name: "Yahoo!", founded_year: 1994, tag_list: ["search", "webmail"], is_active: true } Select true statement.
Question 4
The greater the cardinality of a field, the...
Question 5
Consider a one-to-one relationship observed between users and the users details. Basic information about application users is separated from detailed information. Which of the following are true about modeling this one-to-one relationship with the document model in MongoDB?
