MongoDB Primer

Quiz
•
Computers
•
University
•
Medium
Aka People
Used 36+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 5 pts
What kind of NoSQL database MongoDB is?
Document Oriented
Key Value
Graph
Column Oriented
2.
MULTIPLE CHOICE QUESTION
5 mins • 10 pts
Which of the following is a valid MongoDB JSON document:
{}
{ "user_id"=1, "user_name"="Joe Sanders", "occupation"=["engineer","writer"] }
{ "user_id":1; "user_name":"Joe Sanders"; "occupation":["engineer","writer"] }
{ "user_id":1, "user_name":"Joe Sanders", "occupation":[ "occupation1":"engineer", "occupation2":"writer" ] }
3.
MULTIPLE CHOICE QUESTION
5 mins • 15 pts
What does the output x of the following MongoDB aggregation query result into:
db.posts.aggregate( [ { $group: { _id: "$author", x: { $sum: $likes } } } ] )
Average of likes on all the posts of an author, grouped by author
Number of posts by an author
Sum of likes on all the posts by an author, grouped by author
Sum of likes on all the posts by all the authors
4.
MULTIPLE CHOICE QUESTION
5 mins • 15 pts
Consider that you have the following two documents in the products collection:
{ "_id" : 1, "prices" : [ 60, 100, 200 ] }
{ "_id" : 2, "prices" : [ 20, 90, 150 ] }
What will the following query result into:
db.products.update( { _id: 1, prices: 100 }, { $set: { "prices.$" : 111 } } )
Updates 60 to 100
Updates 100 to 111
Updates 60,100 and 200 to 111
Removes the three elements of the prices array and replaces it only a single element 111
5.
MULTIPLE CHOICE QUESTION
5 mins • 15 pts
Which of the following aggregation query will sort the posts collection with author key ascending:
db.posts.aggregate([ {$sort:{ author:1 } } ])
db.posts.aggregate([ {$sort:{ author:-1 } } ])
db.posts.aggregate([ {author: {$sort: 1} } ])
You need to first use $group or $project or $match command before $sort in the pipeline
6.
MULTIPLE CHOICE QUESTION
5 mins • 15 pts
Which of the following commands create an unique index on author field of the posts collection?
db.posts.createIndex({"author":1 }, {"unique": true});
db.posts.createIndex({"author": unique });
db.posts.createIndex({"author": {$unique:1} });
db.posts.createIndexUnique({"author":1 });
7.
MULTIPLE CHOICE QUESTION
5 mins • 15 pts
In a collection that contains 100 post documents, what does the following command do?
db.posts.find().skip(5).limit(5)
Skip and limit nullify each other. Hence returning the first five documents.
Skips the first five documents and returns the sixth document five times
Skips the first five documents and returns the next five
Limits the first five documents and then return them in reverse order
Create a free account and access millions of resources
Similar Resources on Wayground
8 questions
Big Data Analytics Introduction

Quiz
•
University - Professi...
15 questions
Internet Basics

Quiz
•
University
12 questions
Web Apps 03 - MongoDB

Quiz
•
University
13 questions
MONGO

Quiz
•
University
12 questions
15-mavzu. Pythonda MongoDB asosida ma‘lumotlarni qidirish va tar

Quiz
•
University
8 questions
WCE Objective 1: Manage Categories and Tags

Quiz
•
9th Grade - University
10 questions
Creative Development and Data | Quiz 2

Quiz
•
University
10 questions
GNKUSITVEC101

Quiz
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade