Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

MongoDB MCQ Set 1

1. MongoDB stores additional instance-local metadata in the _______ database.
a) Master
b) Model
c) Local
d) All of the mentioned

View Answer

Answer: c [Reason:] It is stored specifically for replication purposes.

2. Point out the correct statement :
a) You can limit the number of incoming connections using the maxConnections run-time option
b) mongos instances maintain a connection pool to each shard so that the mongos can reuse connections
c) You can use the limit command at the system prompt to check system limits
d) All of the mentioned

View Answer

Answer: b [Reason:] This would quickly fulfill requests without needing to create new connections.

3. The ___________ collection stores custom roles that administrators create and assign to users to provide access to specific resources.
a) admin.system.role
b) admin.system.roles
c) admin.system.roleasign
d) all of the mentioned

View Answer

Answer: b [Reason:] System collections include these collections stored in the admin database

4. The ___________ collection stores the user’s authentication credentials as well as any roles assigned to the user
a) admin.system.auth
b) admin.system.users
c) admin.system.usersauth
d) all of the mentioned

View Answer

Answer: b [Reason:] Users may define authorization roles in the admin.system.roles collection.

5. Point out the wrong statement :
a) The “hard” ulimit refers to the maximum number of processes that a user can have active at any time
b) The “soft” ulimit refers to the minimum number of processes that a user can have active at any time
c) ulimit will modify both “hard” and “soft” values unless the -H or -S modifiers are specified when modifying limit values
d) None of the mentioned

View Answer

Answer: b [Reason:] There are both “hard” and the “soft” ulimits that affect MongoDB’s performance.

6. The .system.indexes collection lists all the _________ in the database
a) serverinfo
b) indexes
c) profiling
d) all of the mentioned

View Answer

Answer: b [Reason:] The .system.profile collection stores database profiling information. For information on profiling.

7. Which of the following The collection holds special JavaScript code for use in server side JavaScript ?
a) <database>.system.jserver
b) <database>.system.jscript
c) <database>.system.js
d) none of the mentioned

View Answer

Answer: c [Reason:] Do not store application logic in the database.

8. Which of the following can store JavaScript functions for reuse ?
a) store.js
b) system.js
c) system.store.js
d) save.js

View Answer

Answer: b [Reason:] To store a function, you can use the db.collection.save().

9. ______ is used to load all the scripts saved in the system.js collection for the current database.
a) db.loadServerScripts()
b) db.loadScripts()
c) db.loadServerScriptsjs()
d) none of the mentioned

View Answer

Answer: a [Reason:] The documents in the system.js collection provide functions that your applications can use in any JavaScript context with MongoDB in this database.

10. In replica sets, each ________ maintains a connection to all other members of the set.
a) serverInfo
b) mongod
c) mongos
d) none of the mentioned

View Answer

Answer: b [Reason:] mongod uses background threads for a number of internal processes, including TTL collections, replication, and replica set health checks, which may require a small number of additional resources.

MongoDB MCQ Set 2

1. When creating a text index on multiple fields, you can specify the individual fields or you can use wildcard specifier ______
a) ($*)
b) (**$**)
c) ($**)
d) None of the mentioned

View Answer

Answer: c [Reason:] You can create a text index on the field or fields whose value is a string or an array of string elements.

2. Point out the wrong statement :
a) In order to drop a text index, use the index name
b) The default language associated with the indexed data determines the rules to parse word roots and ignore stop words
c) To allow for text search on all fields with string content, use the wildcard specifier ($$$) to index all fields that contain string content
d) None of the mentioned

View Answer

Answer: c [Reason:] In the aggregation pipeline, text search is available via the use of the $text query operator in the $match stage.

3. The default language for the indexed data is ________
a) chinese
b) english
c) spanish
d) none of the mentioned

View Answer

Answer: b [Reason:] To specify a different language, use the default_language option when creating the text index.

4. If a collection contains documents or embedded documents that are in different languages, include a field named _______ in the documents.
a) operator
b) lang
c) language
d) all of the mentioned

View Answer

Answer: b [Reason:] MongoDB will use the specified language for that document or embedded document when building the text index.

5. Point out the correct statement :
a) After 2.4, you can terminate both background index builds and foreground index builds
b) The specified language in the document overrides the default language for the text index
c) The text index, like other indexes,should not fall within the index name length limit
d) None of the mentioned

View Answer

Answer: b [Reason:] To get the names of the indexes, use the db.collection.getIndexes() method.

6. To use a field with a name other than language, include the ________ option when creating the index.
a) language_over
b) language_override
c) langoverride
d) none of the mentioned

View Answer

Answer: b [Reason:] You cannot combine the $text query, which requires a special text index, with a query operator that requires a different type of special index.

7. The default name for the index consists of each indexed field name concatenated with _______
a) _char
b) _textc
c) _text
d) All of the mentioned

View Answer

Answer: c [Reason:] Whether the text index has the default name or you specified a name for the text index, to drop the text index, pass the index name to the db.collection.dropIndex() method.

8. To avoid creating an index with a name that exceeds the index name length limit, you can pass the _____ option to the db.collection.createIndex() method.
a) name
b) lang
c) number
d) all of the mentioned

View Answer

Answer: a [Reason:] The measuring units for the maximum distance are determined by the coordinate system in use.

9. The default weight is ____ for the indexed fields.
a) 1
b) 2
c) 3
d) 4

View Answer

Answer: a [Reason:] To adjust the weights for the indexed fields, include the weights option in the db.collection.createIndex() method.

10. For a ______ index, the weight of an indexed field denotes the significance of the field relative to the other indexed fields in terms of the score.
a) unique
b) natural
c) text
d) all of the mentioned

View Answer

Answer: b [Reason:] If the compound text index includes keys preceding the text index key, to perform a $text search, the query predicate must include equality match conditions on the preceding keys.

MongoDB MCQ Set 3

1. _________ prevents the current member from seeking election as primary for a period of time.
a) replSetGetStatus
b) replSetFreeze
c) replSetInitiate
d) all of the mentioned

View Answer

Answer: b [Reason:] The replSetFreeze command prevents a replica set member from seeking election for the specified number of seconds.

2. Point out the wrong statement:
a) Primary capture data from the primary member to maintain an up to date copy of the sets’ data
b) For some deployments, implementing a custom replication sync topology may be more effective than the default sync target selection logic
c) MongoDB provides the ability to specify a host to use as a sync target
d) None of the mentioned

View Answer

Answer: d [Reason:] However, by default secondaries may automatically change their sync targets to secondary members based on changes in the ping time between members and the state of other members’ replication.

3. ________ returns a document that reports on the status of the replica set.
a) replSetGetStatus
b) replSetFreeze
c) replSetInitiate
d) all of the mentioned

View Answer

Answer: a [Reason:] The replSetGetStatus command returns the status of the replica set from the point of view of the current server.

4. __________ enables or disables a maintenance mode, which puts a secondary node in a RECOVERING state.
a) replSetReconfig
b) replSetMaintenance
c) replSetStepDown
d) all of the mentioned

View Answer

Answer: b [Reason:] The replSetMaintenance admin command enables or disables the maintenance mode for a secondary member of a replica set.

5. Point out the correct statement :
a) To affect the sync target for the initial sync, run rs.syn() operation before initial sync
b) If you run rs.syncFrom() during initial sync, MongoDB produces no error messages
c) replSetSyncFrom and rs.syncFrom() provide a permanent override of default behavior
d) All of the mentioned

View Answer

Answer: b [Reason:] The sync target falls more than 30 seconds behind another member of the replica set; the mongod will revert to the default sync target.

6. When enabled replSetMaintenance: true, the member enters the ________ state.
a) REPLICATING
b) RECOVERING
c) STALE
d) All of the mentioned

View Answer

Answer: b [Reason:] The member is not accessible for read operations.

7. ________ applies a new configuration to an existing replica set.
a) replSetReconfig
b) replSetMaintenance
c) replSetStepDown
d) all of the mentioned

View Answer

Answer: a [Reason:] The replSetReconfig command modifies the configuration of an existing replica set.

8. Which of the command is for master-slave replication only ?
a) replSetSyncFrom
b) resync
c) applyOps
d) isMaster

View Answer

Answer: b [Reason:] resync forces a mongod to re-synchronize from the master.

9. _______ is an internal command that applies oplog entries to the current data set.
a) replSetSyncFrom
b) resync
c) applyOps
d) isMaster

View Answer

Answer: c [Reason:] The applyOps command is primarily an internal command.

10. __________ explicitly override the default logic for selecting a member to replicate from.
a) replSetSyncFrom
b) resync
c) applyOps
d) isMaster

View Answer

Answer: a [Reason:] replSetSyncFrom explicitly configures which host the current mongod pulls oplog entries from.

MongoDB MCQ Set 4

1. The preferred way to clear the _________ flag from a chunk is to attempt to split the chunk.
a) boolean
b) jumbo
c) change
d) all of the mentioned

View Answer

Answer: b [Reason:] If the chunk is divisible, MongoDB removes the flag upon successful split of the chunk.

2. Point out the correct statement:
a) In some instances, MongoDB cannot split the no-longer jumbo chunk, such as a chunk with a range of single shard key value
b) To ensure that mongos instances update their cluster information cache, run flushConfig in the admin database
c) In a sharded cluster, you cannot use tags to associate specific ranges of a shard key with a specific shard or subset of shards
d) All of the mentioned

View Answer

Answer: a [Reason:] If you clear the jumbo flag for a chunk that still exceeds the chunk size and/or the document number limit, MongoDB will re-label the chunk as jumbo when MongoDB tries to move the chunk.

3. _________ is used to remove tags from a particular shard.
a) sh.removeTag()
b) sh.removeShard()
c) sh.removeShardTag()
d) all of the mentioned

View Answer

Answer: c [Reason:] You may remove tags from a particular shard using the sh.removeShardTag() method when connected to a mongos instance.

4. ________ associates a shard with a tag or identifier.
a) sh.collects()
b) sh.addShardTag
c) sh.results()
d) all of the mentioned

View Answer

Answer: b [Reason:] MongoDB uses these identifiers to direct chunks that fall within a tagged range to specific shards.

5. Point out the wrong statement :
a) You cannot overlap defined ranges, or tag the same range more than once
b) The mongod provides a helper for removing a tag range
c) The output from sh.status() lists tags associated with a shard, if any, for each shard
d) None of the mentioned

View Answer

Answer: b [Reason:] The mongod does not provide a helper for removing a tag range.

6. To assign a tag to a range of shard keys use the _________ method when connected to a mongos instance.
a) sh.addTagRange()
b) sh.splitFind()
c) sh.Range()
d) all of the mentioned

View Answer

Answer: a [Reason:] You may delete tag assignment from a shard key range by removing the corresponding document from the tags collection of the config database.

7. Each document in the tags holds the ________ of the sharded collection and a minimum shard key value.
a) tag
b) chunk
c) namespace
d) size

View Answer

Answer: c [Reason:] In most circumstances, you should leave chunk splitting to the automated processes within MongoDB.

8. Which of the following parameter represents minimum value of the shard key range to include in the tag ?
a) min
b) max
c) maximum
d) minimum

View Answer

Answer: d [Reason:] The minimum is an inclusive match.

9. Use ________ to ensure that the balancer migrates documents that exist within the specified range to a specific shard .
a) sh.addShardTag()
b) sh.addTag()
c) sh.aShardTag()
d) all of the mentioned

View Answer

Answer: a [Reason:] Only issue sh.addTagRange() when connected to a mongos instance.

10. Which of the following parameter denotes name of the shard from which to remove a tag ?
a) shard
b) tag
c) chunk
d) none of the mentioned

View Answer

Answer: a [Reason:] Shard is of string type.

MongoDB MCQ Set 5

1. 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

View Answer

Answer: b [Reason:] The localhost exception allows you to enable authorization before creating the first user in the system.

2. Point out the correct statement :
a) To provide user administrators, MongoDB has userAdmin and userAdminAnyDatabase roles
b) A user administrator can grant any privilege in the database and can create new ones
c) Specifically, a user with the userAdmin role can grant itself any privilege in the database
d) All of the mentioned

View Answer

Answer: d [Reason:] A user assigned either the userAdmin role on the admin database or the userAdminAnyDatabase can grant itself any privilege in the system.

3. Grant the user the role using the ________ method.
a) db.grantRole()
b) db.grantRolesToUser()
c) db.grantToUser()
d) all of the mentioned

View Answer

Answer: b [Reason:] If the user requires additional privileges, grant to the user the role, or roles, with the required set of privileges.

4. 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

View Answer

Answer: c [Reason:] db.getRole() wraps the rolesInfo command.

5. Point out the wrong statement :
a) You must have the createUser action on a database to create a new user on that database
b) You must have the grantRole action on a role’s database to grant the role to another user
c) If your MongoDB deployment has no users, you must connect to mongod using the localhost exception
d) None of the mentioned

View Answer

Answer: a [Reason:] You can use –noauth option when starting mongod to gain full access the system.

6. ____________ removes a one or more roles from a user on the current database.
a) db.revokeRolesUser()
b) db.revokeRoles()
c) db.revokeRolesFromUser()
d) none of the mentioned

View Answer

Answer: c [Reason:] To specify a role that exists in the same database where db.revokeRolesFromUser() runs, you can either specify the role with the name of the role.

7. You must have the __________ action on a database to revoke a role on that database.
a) revokePrivelege
b) revokeUser
c) revokeRole
d) all of the mentioned

View Answer

Answer: c [Reason:] User can remove any role from any user from any database in the system.

8. 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

View Answer

Answer: b [Reason:] To change your own password, you must have the changeOwnPassword action on your database.

9. 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

View Answer

Answer: a [Reason:] You can use the openssl program to generate unique strings for use in passwords, as in the following command: openssl rand -base64 48

10. The ________ field contains optional custom information about the user.
a) customDataAll
b) OptmData
c) customData
d) all of the mentioned

View Answer

Answer: c [Reason:] The system.users collection in the admin database stores user authentication and authorization information.

MongoDB MCQ Set 6

1. Ops Manager reads directly from the Backup Blockstore database and transfers files either through :
a) TCP
b) HTTPS
c) MMS
d) All of the mentioned

View Answer

Answer: b [Reason:] Ops Manager Backup lets you restore data from a scheduled snapshot or from a selected point between snapshots.

2. Point out the correct statement :
a) The amount of oplog to keep per backup is configurable and affects the time window available for checkpoint and point-in-time restores
b) To get a consistent snapshot of a sharded system, you must enable the balancer
c) Backups produced by copying the underlying data do support point in time recovery
d) All of the mentioned

View Answer

Answer: a [Reason:] When you restore from a checkpoint or point in time, Ops Manager first creates a local restore of a snapshot from the blockstore and then applies stored oplogs until the specified point is reached.

3. Ops Manager maintains one _____ database for each backed-up replica set
a) mdump
b) head
c) tail
d) all of the mentioned

View Answer

Answer: b [Reason:] The head database is consistent with the original primary up to the last oplog supplied by the agent.

4. The agent ships initial sync and oplog data over HTTPS back to:
a) Opscore Manager
b) Ops Manager
c) mongod
d) None of the mentioned

View Answer

Answer: b [Reason:] Backup performs the initial sync and the tailing of the oplog using standard MongoDB queries.

5. Point out the wrong statement :
a) MongoDB Cloud Manager Backup offers point in time recovery of MongoDB replica sets
b) MongoDB Cloud Manager continually backs up MongoDB replica sets
c) MMS achieves point in time recovery by storing oplog data
d) None of the mentioned

View Answer

Answer: c [Reason:] MongoDB Cloud Manager Backup also offers a consistent snapshot of sharded clusters.

6. If your storage system does not support snapshots, you can copy the files directly using :
a) cp
b) copy
c) snap
d) none of the mentioned

View Answer

Answer: a [Reason:] Since copying multiple files is not an atomic operation, you must stop all writes to the mongod before copying the files.

7. Backup can also create snapshots of _________ that are run as single-member replica sets.
a) documents
b) standalones
c) backups
d) none of the mentioned

View Answer

Answer: b [Reason:] A lightweight Backup Agent runs within your infrastructure and backs up data from the MongoDB processes you have specified.

8. Ops Manager _________ provides an interface for configuring MongoDB nodes and clusters and for upgrading your MongoDB deployment.
a) Automation
b) Performance
c) Monitoring
d) None of the mentioned

View Answer

Answer: a [Reason:] Ops Manager Monitoring provides real-time reporting, visualization, and alerting on key database and hardware indicators.

9. _________ allows only one agent of each type per machine and will remove additional agents.
a) Automation
b) Performance
c) Monitoring
d) Backup

View Answer

Answer: a [Reason:] Backup can also create snapshots of standalones that are run as single-member replica sets.

10. Sharded clusters snapshots temporarily stop the balancer via :
a) Mongod
b) MMS
c) MonitorMMS
d) Mongos

View Answer

Answer: d [Reason:] Backup takes and stores snapshots based on a user-defined snapshot retention policy.

MongoDB MCQ Set 7

1. __________ precision multiplies the monetary value by a power of 10.
a) Exact
b) Accurate
c) Ambiguity
d) None of the mentioned

View Answer

Answer: a [Reason:] MongoDB stores numeric data as either IEEE 754 standard 64-bit floating point numbers or as 32-bit or 64-bit signed integers.

2. Point out the correct statement :
a) Applications that handle monetary data often require capturing fractional units of currency
b) Applications that handle time data often require capturing fractional units of currency
c) Applications that handle temporal and spatial data often require capturing fractional units of currency
d) All of the mentioned

View Answer

Answer: a [Reason:] Some fractional numeric quantities, such as one third and one tenth, have no exact representation in binary floating point numbers.

3. Which of the following precision uses two values for the field ?
a) Exact
b) Accurate
c) Ambiguity
d) None of the mentioned

View Answer

Answer: c [Reason:] Arbitrary Precision which uses two fields for the value: one field to store the exact monetary value as a non-numeric and another field to store a floating point approximation of the value.

4. MongoDB stores times in _____ by default, and will convert any local time representations into this form.
a) UTC
b) GMT
c) IST
d) None of the mentioned

View Answer

Answer: a [Reason:] Applications that must operate or report on some unmodified local time value may store the time zone alongside the UTC timestamp, and compute the original local time in their application logic.

5. Point out the wrong statement :
a) If you need to query the database for exact, mathematically valid matches, use Exact Precision
b) If you regularly need to perform server-side arithmetic on monetary data, the exact precision model may be appropriate
c) If you need to query the database for exact, mathematically valid matches, use Ambiguity Precision
d) None of the mentioned

View Answer

Answer: c [Reason:] If you need to be able to do server-side arithmetic, e.g., $inc, $mul, and aggregation framework arithmetic, use Exact Precision.

6. ___________ bulk indexes may be more efficient for some kinds of content and workloads in real time.
a) Synchronous
b) Asynchronous
c) Unique
d) None of the mentioned

View Answer

Answer: b [Reason:] MongoDB can support keyword searches using specific data models and multi-key indexes.

7. Which of the following is used to handle arbitrary or unforeseen number of precision ?
a) Exact
b) Accurate
c) Ambiguity
d) None of the mentioned

View Answer

Answer: c [Reason:] If there is no need to perform server-side arithmetic on monetary data, modeling monetary data using the arbitrary precision model may be suitable.

8. Use of the approximation field for the query and sort operations requires that applications perform _______-side post-processing
a) client
b) server
c) application
d) none of the mentioned

View Answer

Answer: a [Reason:] Client side processing is used to decode the non-numeric representation of the exact value and then filter out the returned documents based on the exact monetary value.

9. The ______ factor is a constant and known property of the currency.
a) rank
b) scale
c) high
d) none of the mentioned

View Answer

Answer: b [Reason:] Applications can determine the scale factor from the currency.

10. In one field, exact monetary value is encoded as a _________ data type.
a) numeric
b) character
c) non numeric
d) none of the mentioned

View Answer

Answer: b [Reason:] In one field,Exact monetary value is encoded as a non-numeric data type; e.g., BinData or a string.

MongoDB MCQ Set 8

1. Indexes are typically available in ______ or located sequentially on disk.
a) RAM
b) ROM
c) CMOS
d) None of the mentioned

View Answer

Answer: a [Reason:] Querying only the index can be much faster than querying documents outside of the index.

2. Point out the wrong statement :
a) Query selectivity refers to how well the query predicate excludes or filters out documents in a collection
b) Query selectivity can determine whether or not queries can use indexes effectively or even use indexes at all
c) More selective queries match a larger percentage of documents
d) All of the mentioned

View Answer

Answer: c [Reason:] More selective queries match a smaller percentage of documents.

3. ___________ is used to determine whether a query is a covered query.
a) explainstats()
b) explain()
c) explainall()
d) all of the mentioned

View Answer

Answer: b [Reason:] db.collection.explain() provides information on the execution of other operations, such as db.collection.update().

4. The ________ message is used to update a document in a collection.
a) UPDATE
b) OP_UPDATE
c) OP_UPDATES
d) All of the mentioned

View Answer

Answer: b [Reason:] Only the OP_QUERY and OP_GET_MORE messages result in a response from the database.

5. Point out the correct statement :
a) An equality match on the unique _id field is less selective as it can match at most one document
b) The selectivity of regular expressions depends on the expressions themselves
c) Less selective queries can use indexes effectively or even at all
d) All of the mentioned

View Answer

Answer: b [Reason:] If an index exists for the field, then MongoDB matches the regular expression against the values in the index, which can be faster than a collection scan.

6. _____ can modify specific fields of an existing document or documents or replace an existing document entirely, depending on the update parameter.
a) modify()
b) update()
c) find()
d) none of the mentioned

View Answer

Answer: b [Reason:] By default, the update() method updates a single document.

7. The update() method uses the _______ command, which uses the default write concern.
a) find
b) read
c) update
d) modify

View Answer

Answer: c [Reason:] The update() method returns an object that contains the status of the operation.

8. _________ is used to view statistics about the query plan for a given query.
a) db.explain()
b) cursor.explain()
c) cursor.explainstats()
d) all of the mentioned

View Answer

Answer: b [Reason:] This information can help as you develop indexing strategies.

9. An ________ query plan has returned a threshold number of matching results
a) execution
b) unordered
c) ordered
d) none of the mentioned

View Answer

Answer: c [Reason:] An ordered query plan has returned all the matching results.

10. A query _______ consists of a combination of query, sort, and projection specifications.
a) plan
b) shape
c) stats
d) all of the mentioned

View Answer

Answer: b [Reason:] Index filters determine which indexes the optimizer evaluates for a query shape.