MongoDB Primer

MongoDB Primer

University

10 Qs

quiz-placeholder

Similar activities

BDD Quiz

BDD Quiz

University

9 Qs

MONGO

MONGO

University

13 Qs

PAW-Q1-2023

PAW-Q1-2023

University

10 Qs

Basic Laravel, Flutter and API

Basic Laravel, Flutter and API

7th Grade - University

10 Qs

NoSQL

NoSQL

University

11 Qs

SGBDs NoSQL orientado a documentos

SGBDs NoSQL orientado a documentos

University

12 Qs

Verilənlər Bazasında həndəsi obyektlərin modelləşdirilməsi

Verilənlər Bazasında həndəsi obyektlərin modelləşdirilməsi

University

10 Qs

Big Data Quizz 2

Big Data Quizz 2

University

11 Qs

MongoDB Primer

MongoDB Primer

Assessment

Quiz

Computers

University

Medium

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?