MongoDB Concepts 1

MongoDB Concepts 1

University

10 Qs

quiz-placeholder

Similar activities

Excel Basics Quiz

Excel Basics Quiz

10th Grade - University

14 Qs

Hệ quản trị cơ sở dữ liệu - Kiểm tra thường xuyên 3

Hệ quản trị cơ sở dữ liệu - Kiểm tra thường xuyên 3

University

10 Qs

Raspodijeljeni sustavi - uvodne vježbe

Raspodijeljeni sustavi - uvodne vježbe

University

12 Qs

DBMS Group 8 Review Quiz

DBMS Group 8 Review Quiz

University

15 Qs

CLC Lesson 7 Quiz

CLC Lesson 7 Quiz

University

12 Qs

Întrebări despre Sistemul de Operare

Întrebări despre Sistemul de Operare

7th Grade - University

13 Qs

LibreOffice Writer Styles Quiz

LibreOffice Writer Styles Quiz

10th Grade - University

15 Qs

Mail Merge

Mail Merge

10th Grade - University

12 Qs

MongoDB Concepts 1

MongoDB Concepts 1

Assessment

Quiz

Information Technology (IT)

University

Medium

Created by

Albert Gil

Used 18+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which document formats are typically used for documents stored in a document-based NoSQL database?

XML and CSV format.

XML and JSON format.

CSV and JSON format.

PDF and JSON format.

Answer explanation

Document-based NoSQL databases commonly use XML and JSON formats for storing data due to their flexibility and ability to represent complex structures. Thus, the correct answer is XML and JSON format.

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following tasks cannot be completed with an aggregation pipeline? (Select one.)

Filtering for relevant pieces of data

Finding data from outside sources

Grouping documents

Calculating total values from a field across many documents

Answer explanation

The aggregation pipeline can filter, group, and calculate values from documents within the database. However, it cannot access or find data from outside sources, making 'Finding data from outside sources' the correct choice.

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

You have a collection that contains zip codes in the United States. Here’s a sample document from this collection:

{ "_id": ObjectId('5c8eccc1caa187d17ca6eea2'),

"city": "EVERGREEN",

"zip": "36401",

"loc": { "y": 31.458009, "x": 86.925771 },

"pop": 8556, "state": "AL" }

What will the output of this aggregation pipeline be? (Select one.)

db.zips.aggregate([ { $match: { "state": "CA" } }, { $group: { "_id": "$zip" } } ])

One document for each city located in California (CA)

One document for each zip code located in California (CA)

The total number of documents that contain a zip code in the state of California (CA)

All documents that contain a zip where the state is California (CA)

Answer explanation

The aggregation pipeline first filters documents to only those with state 'CA'. Then, it groups by zip code, resulting in one document for each unique zip code in California.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the $count stage return? (Select one.)

A single document with one field that contains the value set to the number of documents at this stage in the aggregation pipeline.

The number of groups in an aggregation pipeline.

A set number of documents from the aggregation pipeline.

A single document that contains the number of fields that have been modified in an aggregation pipeline.

Answer explanation

The $count stage returns a single document with one field that indicates the total number of documents processed at that point in the aggregation pipeline, making the first choice correct.

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

  1. Which query operator in MongoDB is used to compare if a value is greater than another?

  • $lt

$gte

$gt

$eq

Answer explanation

In MongoDB, the $gt operator is used to compare if a value is greater than another. The other options serve different purposes: $lt checks for less than, $gte for greater than or equal to, and $eq for equality.

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

  1. Which of the following is not a valid stage in an aggregation pipeline in MongoDB?

$match

$sort

$join

$group

Answer explanation

In MongoDB's aggregation pipeline, valid stages include $match, $sort, and $group. However, $join is not a valid stage; instead, MongoDB uses $lookup for joining collections.

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

  1. Given the following document in a products collection:

{ "_id": ObjectId('5c8eccc1caa187d17ca6eea2'),

"name": "Laptop",

"price": 1200,

"category": "Electronics"}

What does the query db.products.find({ price: { $lt: 1500 } }) return?

  • All documents with a price less than 1500.

  • All documents with a price greater than 1500.

  • All documents with a price equal to 1500.

  • No documents, since $lt is not a valid operator.

Answer explanation

The query db.products.find({ price: { $lt: 1500 } }) returns all documents with a price less than 1500. Since the document has a price of 1200, it meets this condition.

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?