Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

MongoDB Quiz

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

MongoDB is primarily classified as:

a)

Relational Database

b)

Document-Oriented Database

c)

Graph Database

d)

Columnar Database

2.

The default port for MongoDB is:

a)

1433

b)

1521

c)

27017

d)

3306

3.

In MongoDB, a collection is equivalent to which in relational databases?

a)

Row

b)

Column

c)

Table

d)

Index

4.

Which of the following formats does MongoDB use to store data internally?

a)

JSON

b)

BSON

c)

XML

d)

CSV

5.

The _id field in MongoDB:

a)

Is optional

b)

Must be unique per collection

c)

Can be changed anytime

d)

Is only used in indexes

6.

Which command lists all available databases in MongoDB shell?

a)

show dbs

b)

db.show()

c)

show collections

d)

list databases

7.

Which method inserts multiple documents in MongoDB?

a)

insert()

b)

insertOne()

c)

insertMany()

d)

addDocuments()

8.

The default storage engine in MongoDB 3.2+ is:

a)

InnoDB

b)

WiredTiger

c)

MMAPv1

d)

RocksDB

9.

Which operator is used to match values greater than a specified value?

a)

$lt

b)

$lte

c)

$gt

d)

$eq

10.

Which MongoDB feature allows horizontal scaling by distributing data?

a)

Replication

b)

Indexing

c)

Aggregation

d)

Sharding

11.

Which aggregation stage groups documents by a field?

a)

$sort

b)

$group

c)

$match

d)

$limit

12.

Which index type is used for location-based queries?

a)

Text Index

b)

Hashed Index

c)

2dsphere Index

d)

Compound Index

13.

In replication, which node receives all write operations?

a)

Secondary

b)

Primary

c)

Arbiter

d)

Hidden Node

14.

What is the default database when you start MongoDB shell?

a)

default

b)

main

c)

admin

d)

test

15.

Which command shows all collections in the current database?

a)

show collections

b)

list tables

c)

db.listCollections()

d)

Both A and C

16.

Which method is used to update only specific fields in a document?

a)

replaceOne()

b)

updatePartial()

c)

updateOne() with $set

d)

patch()

17.

In MongoDB, replication primarily provides:

a)

Faster queries

b)

Data redundancy and failover

c)

Encryption

d)

Aggregation support

18.

The find() method in MongoDB shell returns results in:

a)

XML

b)

JSON-like format (internally BSON)

c)

CSV

d)

YAML

19.

Which of the following is NOT a valid MongoDB data type?

a)

Boolean

b)

Double

c)

Date

d)

Table

20.

Which operator in MongoDB is used for pattern matching in strings?

a)

$regex

b)

$like

c)

$pattern

d)

$search