Explore topic-wise MCQs in Mongodb.

This section includes 62 Mcqs, each offering curated multiple-choice questions to sharpen your Mongodb knowledge and support exam preparation. Choose a topic below to get started.

1.

Which of the following is used to display the replica set configuration object?

A. rs.config
B. rs.conf
C. rs.confrepl
D. none of the mentioned
Answer» C. rs.confrepl
2.

You must have the __________ action on a role’s database to grant the role to another user.

A. grantRole
B. grantRoleAdm
C. grantRolePrivilege
D. none of the mentioned
Answer» B. grantRoleAdm
3.

Identify the message returned by MongoDB applications for Windows due to failures installing?

A. Message: ERROR: wsastartup failed <reason>
B. Message: NT Service Error
C. Message: wsastartup failed <reason>
D. None of the mentioned
Answer» C. Message: wsastartup failed <reason>
4.

The _________ message limit can result in the truncation of the audit messages.

A. oplog
B. syslog
C. evallog
D. none of the mentioned
Answer» C. evallog
5.

On Linux, MongoDB clients can use Kerberos’s _______ program to initialize a credential cache for authenticating the user principal to servers.

A. knight
B. kinit
C. Knite
D. None of the mentioned
Answer» C. Knite
6.

The net.http.RESTInterfaceEnabled setting for mongod enables a fully interactive administrative __________ interface, which is disabled by default.

A. Restful
B. Rest
C. WebService
D. All of the mentioned
Answer» C. WebService
7.

Which of the following code is returned by mongod if a moveChunk operation fails to confirm a commit?

A. 5
B. 6
C. 7
D. 3
Answer» B. 6
8.

enableLocalhostAuthBypass is not available using _________ database command.

A. setParameter
B. enableParameter
C. removeParameter
D. none of the mentioned
Answer» B. enableParameter
9.

Which of the following method is used for managing user?

A. db.createUser()
B. db.User()
C. db.superuser()
D. none of the mentioned
Answer» B. db.User()
10.

On _________ mongo.exe reads the .mongorc.js file from %HOME%.mongorc.js.

A. Windows
B. Linux
C. Mac
D. Solaris
Answer» B. Linux
11.

Instance exits cleanly are represented by ___ exit code.

A. 4
B. 1
C. 2
D. 3
Answer» B. 1
12.

The MongoDB _________ Console interface does not support Kerberos authentication.

A. TCP
B. HTTP
C. HTTPS
D. None of the mentioned
Answer» C. HTTPS
13.

Which of the following flushes user information from in-memory cache?

A. grantCache
B. invalidateUserCache
C. validateUserCache
D. none of the mentioned
Answer» C. validateUserCache
14.

By default, the policy in ___________ Firewall allows all outbound connections and blocks all incoming connections.

A. Windows
B. Linux
C. Mac
D. None of the mentioned
Answer» B. Linux
15.

Which of the following keyword represents lock on the collection?

A. Database
B. Collection
C. Metadata
D. All of the mentioned
Answer» C. Metadata
16.

__________ can be used to limit the size of the result document for a query operation.

A. limit()
B. aggregate()
C. skip()
D. none of the mentioned
Answer» B. aggregate()
17.

Every MongoDB mongod and mongos instance (or mongod.exe or mongos.exe on Windows) must have an associated ___________

A. service replica
B. service sets
C. service principal
D. service principle
Answer» D. service principle
18.

Which of the following code is used for the successful exit of task?

A. 0
B. 1
C. 2
D. 3
Answer» B. 1
19.

How many types of locking modes exist in MongoDB?

A. 1
B. 2
C. 3
D. More than 3
Answer» E.
20.

The ________ field contains optional custom information about the user.

A. customDataAll
B. OptmData
C. customData
D. all of the mentioned
Answer» D. all of the mentioned
21.

Command listIndexes.ok returning value 1 indicates ______________

A. failure
B. success
C. abnormal exit
D. none of the mentioned
Answer» C. abnormal exit
22.

Which of the following document represents uncaught exception?

A. 45
B. 49
C. 47
D. 100
Answer» E.
23.

The auditing facility can write audit events to the console, the _________ a JSON file, or a BSON file.

A. oplog
B. syslog
C. evallog
D. none of the mentioned
Answer» C. evallog
24.

_____________ is used to initiate relica member set.

A. rs.rep()
B. rs.init()
C. rs.initiate()
D. none of the mentioned
Answer» D. none of the mentioned
25.

If you create the user administrator before enabling access control, MongoDB disables the ________ exception.

A. localhost
B. server
C. runtime
D. none of the mentioned
Answer» B. server
26.

__________ displays the cached query plans for the specified query shape.

A. CacheListPlans
B. displayCacheListPlans
C. planCacheListPlans
D. none of the mentioned
Answer» C. planCacheListPlans
27.

MongoDB Enterprise supports proxy authentication through ___________

A. SCRAM-SHA-1
B. LDAP
C. MONGODB-CR
D. None of the mentioned
Answer» C. MONGODB-CR
28.

To view the contents of the file, pass the file to the MongoDB utility ___________

A. bsonlog
B. bsonout
C. bsondump
D. SelectIndexes
Answer» D. SelectIndexes
29.

Config servers listen for connections on port __________

A. 27011
B. 27019
C. 27107
D. None of the mentioned
Answer» C. 27107
30.

MongoDB __________ supports authentication using a Kerberos service.

A. Standard
B. Express
C. Enterprise
D. None of the mentioned
Answer» D. None of the mentioned
31.

On Windows systems _________ command line interface provides access to the underlying Windows Firewall.

A. netsh
B. netstat
C. netln
D. SelectIndexes
Answer» B. netstat
32.

________ instances provide query routing for sharded clusters.

A. mongod
B. mongos
C. netstats
D. selectindexes
Answer» C. netstats
33.

Data of .system.indexes can be accessed using ____________

A. listallIndexes
B. listIndexes
C. ViewIndexes
D. SelectIndexes
Answer» C. ViewIndexes
34.

MongoDB users who use VPNs use ________ rather than IPSEC VPNs for performance issues.

A. TTS
B. SSL
C. LTS
D. None of the mentioned
Answer» C. LTS
35.

Which of the following code represents exit cleanly following a large clock skew (32768 milliseconds) event?

A. 45
B. 20
C. 47
D. 100
Answer» D. 100
36.

To view a role’s information, you must be explicitly granted the role or must have the _________ action on the role’s database.

A. viewUser
B. viewRole
C. grantRole
D. none of the mentioned
Answer» C. grantRole
37.

The enabled setting for mongod and mongos instances disables the __________ status page.

A. home
B. primary
C. secondary
D. none of the mentioned
Answer» B. primary
38.

MongoDB supports the execution of JavaScript code for certain server-side operations like ____________

A. where
B. group
C. mapreduce
D. all of the mentioned
Answer» E.
39.

Which of the following represents number of times the operation acquired the lock in the specified mode?

A. system.profile.locks.acquireCount
B. system.profile.locks.acquireWaitCount
C. system.profile.locks.Count
D. none of the mentioned
Answer» B. system.profile.locks.acquireWaitCount
40.

The _____________ option accepts either full path name or relative path name.

A. –auditPathLog
B. –logPath
C. –auditPath
D. None of the mentioned
Answer» D. None of the mentioned
41.

Which of the following authentication method is used by default by MongoDB?

A. SCRAM-SHA-1
B. LDAP
C. MONGODB-CR
D. None of the mentioned
Answer» B. LDAP
42.

Config servers, host the _______ database that stores metadata for sharded clusters.

A. head
B. master
C. config
D. none of the mentioned
Answer» D. none of the mentioned
43.

Which of the following collection is capped?

A. system.index
B. system.replica
C. system.profile
D. all of the mentioned
Answer» D. all of the mentioned
44.

Which of the following code is returned when a MongoDB application cannot open a file?

A. 45
B. 20
C. 47
D. 100
Answer» B. 20
45.

______________ enables a set of internal commands useful for internal testing operations.

A. enableTestAll
B. enableTest
C. enableTestCommands
D. all of the mentioned
Answer» D. all of the mentioned
46.

Administrators can implement collection-level access control through user-defined __________

A. roles
B. replica sets
C. shards
D. none of the mentioned
Answer» B. replica sets
47.

Which of the following method is used to identify the privileges granted by the roles?

A. rolesUser
B. rolesInfo
C. rolesView
D. all of the mentioned
Answer» D. all of the mentioned
48.

You must have the _________ action on a database to modify the password of any user on that database.

A. changePassword
B. changeAnyPassword
C. removePassword
D. none of the mentioned
Answer» C. removePassword
49.

User can remove any role from any user from any database in the system through _________

A. grantRole
B. viewRole
C. killCursors
D. revokeRole
Answer» E.
50.

Which of the following can be used to generate unique strings for use in passwords?

A. openssl
B. openssd
C. oppstringpwd
D. none of the mentioned
Answer» B. openssd