MongoDB C100DBA Practice Test Questions and Exam Dumps Part6 Q101-120

View Full MongoDB C100DBA Exam Dumps and Practice Test Dumps

 

Question 101

Which MongoDB command displays the current replication configuration?

  1. rs.status()
  2. rs.info()
  3. rs.members()
  4. rs.conf()

Correct Answer: 4

Explanation:

rs.conf() returns the replica set configuration document used by MongoDB. It contains settings for members, including host information, voting configuration, priorities, hidden status, and other member properties. DBAs use this command when reviewing topology or preparing controlled replica-set configuration changes. It differs from rs.status(), which focuses on the current operational condition of members rather than the configured topology. Reviewing the configuration is especially important before maintenance because incorrect priorities, votes, or member settings can affect elections and availability. Administrators should preserve an understanding of the existing configuration before making changes.

Question 102

Which MongoDB feature provides ordered operations within a client context?

  1. Client sessions
  2. Storage checkpoints
  3. Collection views
  4. Query indexes

Correct Answer: 1

Explanation:

Client sessions provide MongoDB with a logical context for associating related operations. Sessions are used by drivers for capabilities such as transactions, causal consistency, and retryable operations. They allow MongoDB to maintain operation-related state across multiple commands issued by an application. Session management is generally handled through the MongoDB driver rather than through custom application-level identifiers. DBAs should understand session behavior when troubleshooting transaction workloads, connection utilization, and timeout-related problems. Sessions are not the same as network connections because one logical session can participate in application workflows independently of the physical connection management performed by the driver.

Question 103

Which MongoDB index rule places equality fields before sort fields?

  1. CAP principle
  2. BASE model
  3. ESR rule
  4. CRUD model

Correct Answer: 3

Explanation:

The ESR, or Equality-Sort-Range, guideline helps administrators design effective compound indexes. Fields used for equality predicates are generally placed before fields used for sorting, followed by fields used for range conditions when the workload fits the guideline. This ordering can improve the ability of an index to support filtering and sorting efficiently. ESR is a design guideline rather than an absolute rule for every query. DBAs should validate index choices using actual query plans, data distribution, and workload behavior. Compound-index design should also consider which fields are frequently queried together and the operational cost of maintaining each index.

Question 104

Which setting identifies the database directory used by a MongoDB server?

  1. storagePath
  2. dbPath
  3. dataDirectory
  4. databasePath

Correct Answer: 2

Explanation:

The dbPath configuration option specifies the directory where MongoDB stores its database files. It is one of the fundamental storage settings for a self-managed deployment. The directory must provide suitable capacity, permissions, and performance characteristics for the expected workload. DBAs should monitor free space and storage latency because problems at the filesystem level can directly affect database availability and performance. Changing dbPath requires an appropriate migration or startup procedure rather than simply editing the configuration while the server is running. Backup and recovery planning should also account for the selected storage location.

Question 105

Which MongoDB object presents aggregation results without storing a separate result collection?

  1. View
  2. Snapshot
  3. Replica
  4. Index

Correct Answer: 1

Explanation:

A MongoDB view is a read-only database object defined by an aggregation pipeline. The view does not maintain a separate stored copy of the underlying result documents. When clients query the view, MongoDB processes its underlying pipeline against the source collections. Views can provide reusable transformations and controlled representations of data without duplicating the dataset. Because the pipeline executes when the view is queried, performance depends on the underlying collections, indexes, and aggregation stages. DBAs should evaluate workload frequency and pipeline complexity before using views for heavily accessed analytical or application-facing operations.

Question 106

Which replica set property allows a member to receive no election votes?

  1. priority: 0
  2. hidden: true
  3. votes: 0
  4. delaySecs: 60

Correct Answer: 3

Explanation:

The votes: 0 setting makes a replica set member non-voting. Such a member can still replicate data and serve specialized purposes, but it does not participate in replica-set election voting. Non-voting members can be useful when a deployment requires additional data-bearing members without increasing the number of voting members. This configuration must be planned carefully because voting-member distribution affects election behavior and fault tolerance. A non-voting member is distinct from a priority-zero member: priority controls eligibility to become primary, while votes determine participation in elections. These settings can be configured independently according to topology requirements.

Question 107

Which command can manually force a replica set configuration refresh after changes?

  1. rs.reload()
  2. rs.refresh()
  3. rs.syncConfig()
  4. rs.updateConfig()

Correct Answer: 1

Explanation:

rs.reload() reloads the replica set configuration from the configuration source when supported by the MongoDB environment. It is useful in administrative situations where a member needs to refresh its understanding of the replica set configuration. Configuration management should normally follow MongoDB’s supported replica-set reconfiguration procedures rather than relying on ad hoc changes to configuration files. DBAs should distinguish between configuration refresh operations and commands that actually modify the replica set configuration. Before performing configuration changes, administrators should verify member health, connectivity, and the intended topology to minimize unexpected election or availability effects.

Question 108

Which query result property indicates documents examined during execution?

  1. nReturned
  2. executionTime
  3. totalDocsExamined
  4. documentsRead

Correct Answer: 3

Explanation:

totalDocsExamined is an execution statistic available in explain output that indicates how many documents MongoDB examined while executing a query plan. Comparing this value with nReturned can help DBAs identify queries that examine substantially more documents than they return. A large examination-to-result ratio may indicate inefficient filtering, missing indexes, or a query plan that does not align well with the workload. This metric should be interpreted alongside totalKeysExamined, execution time, and the selected plan. Explain statistics provide valuable diagnostic evidence when investigating query performance.

Question 109

Which sharding method distributes documents according to hashed shard-key values?

  1. Zone sharding
  2. Hashed sharding
  3. Range partitioning
  4. Manual chunk placement

Correct Answer: 2

Explanation:

Hashed sharding applies a hashing function to shard-key values before distributing documents across shards. This approach can provide relatively even distribution when the original key has poor cardinality or is otherwise prone to creating uneven ranges. However, hashed shard keys are generally less suitable for workloads that depend heavily on range queries over the original field. Choosing a shard key requires balancing distribution, query targeting, cardinality, and workload access patterns. DBAs should evaluate actual application queries before selecting hashed sharding because a well-distributed key can still produce inefficient query routing.

Question 110

Which MongoDB process routes client requests in a sharded deployment?

  1. mongod
  2. configsvr
  3. mongos
  4. replicator

Correct Answer: 3

Explanation:

mongos is the query router used by clients to interact with a sharded MongoDB cluster. It receives client requests, consults cluster metadata, and routes operations to the appropriate shards. Applications normally connect to mongos rather than directly selecting individual shards for sharded workloads. Multiple mongos processes can be deployed to provide routing capacity and availability. DBAs should monitor router connectivity, resource utilization, and compatibility with the cluster topology. Properly designed applications use supported MongoDB drivers and connection strings so that routing and topology changes can be handled without hard-coding individual shard destinations.

Question 111

Which command reports replication information including the oplog window?

  1. rs.status()
  2. rs.conf()
  3. rs.printReplicationInfo()
  4. rs.stepDown()

Correct Answer: 3

Explanation:

rs.printReplicationInfo() reports information about the replica set’s oplog, including timestamps that help administrators understand the available replication window. The oplog window is important because a secondary that remains disconnected longer than the available window may no longer be able to catch up using normal replication. In such circumstances, an initial synchronization may be required. DBAs should monitor oplog size and write volume together because high write workloads can consume the available window quickly. Understanding this relationship is important when planning maintenance, disaster recovery, and expected secondary downtime.

Question 112

Which MongoDB setting controls the verbosity of server log messages?

  1. logLevel
  2. logVerbosity
  3. messageLevel
  4. diagnosticLevel

Correct Answer: 2

Explanation:

MongoDB’s log verbosity settings control how much diagnostic information is written to the server log. Increasing verbosity can provide additional details during troubleshooting, but excessive logging may generate substantial output and storage consumption. DBAs should generally use elevated verbosity selectively and return to normal levels after investigating an issue. Log information can be particularly valuable for diagnosing connectivity, replication, storage, and operational problems. Administrators should also ensure that log files are retained and rotated appropriately so that increased diagnostic output does not unexpectedly consume available disk space.

Question 113

Which index type is designed specifically for text-search queries?

  1. Text index
  2. Vector index
  3. Range index
  4. Session index

Correct Answer: 1

Explanation:

A MongoDB text index supports text-search queries against string content. It indexes words from selected fields and enables the $text query operator to search for matching terms. Text indexes are useful for basic text-search requirements, although applications with advanced search needs may require specialized search technologies. DBAs should consider index size, language configuration, tokenization behavior, and write overhead before adding text indexes to large collections. The indexed fields should reflect the application’s actual search requirements. Text indexing should also be evaluated against alternative search capabilities when sophisticated relevance or search features are needed.

Question 114

Which command displays detailed information about a running operation?

  1. db.operationInfo()
  2. db.currentOp()
  3. db.activeTask()
  4. db.runningQueries()

Correct Answer: 2

Explanation:

db.currentOp() provides information about operations currently executing on the MongoDB server. The output can include operation identifiers, namespaces, client information, runtime details, locks, and other diagnostic fields depending on the operation and MongoDB version. DBAs commonly use this command when investigating long-running operations or unexpected resource consumption. After identifying an operation, administrators can determine whether it should continue, be optimized, or be terminated using appropriate administrative controls. Current-operation data should be interpreted in context because a long-running operation is not automatically a problematic operation.

Question 115

Which sharding feature assigns data ranges to preferred geographic or logical locations?

  1. Hashed distribution
  2. Zone sharding
  3. Random placement
  4. Oplog routing

Correct Answer: 2

Explanation:

Zone sharding allows administrators to associate ranges of shard-key values with designated zones and assign shards to those zones. This can help control where particular data ranges are stored based on geographic, regulatory, hardware, or workload requirements. Zone configuration works with shard-key ranges and requires careful planning to avoid creating uneven distribution or operational bottlenecks. DBAs should monitor chunk placement and balancing behavior after introducing zones. Zone sharding is different from hashed distribution because it provides an explicit placement mechanism rather than simply attempting to spread hashed keys across available shards.

Question 116

Which command is commonly used to inspect replication state of all replica members?

  1. rs.status()
  2. rs.members()
  3. rs.health()
  4. rs.replicaInfo()

Correct Answer: 1

Explanation:

rs.status() provides a detailed view of the current state of replica set members. Administrators can use it to identify the primary, examine secondary health, review synchronization progress, and investigate state transitions. The command is particularly useful during replication troubleshooting because it combines several operational indicators in one response. DBAs should review fields such as member state, health, optime information, and sync source when diagnosing lag or connectivity issues. Replica-set status should be interpreted alongside server logs and system monitoring to determine the underlying cause of a replication problem.

Question 117

Which aggregation stage removes selected fields from documents?

  1. $unset
  2. $removeFields
  3. $dropFields
  4. $exclude

Correct Answer: 1

Explanation:

The $unset aggregation stage removes specified fields from documents flowing through a pipeline. It can be useful when preparing output for clients, simplifying documents before later processing, or excluding sensitive or unnecessary fields from results. $unset operates as part of the aggregation pipeline and does not permanently modify the source collection. Administrators should distinguish pipeline transformations from update operations because aggregation output normally represents transformed results rather than direct changes to stored documents. Careful field selection can also reduce the amount of information passed to downstream application components.

Question 118

Which command shows the server’s current connection and operation counters?

  1. db.metrics()
  2. db.statusCounters()
  3. db.serverStatus()
  4. db.runtimeCounters()

Correct Answer: 3

Explanation:

db.serverStatus() provides server-level metrics, including connection information and operation counters. These measurements can help DBAs identify changes in workload intensity, connection growth, and database activity. For example, operation counters can be compared over time to understand whether read or write activity has increased significantly. Connection metrics can also reveal unusual client behavior or capacity concerns. Because serverStatus() produces a large response, monitoring systems commonly extract specific fields and track them over time. Trend analysis is more useful than interpreting a single instantaneous metric without workload context.

Question 119

Which sharded-cluster component stores persistent cluster metadata?

  1. mongos
  2. Config servers
  3. Query clients
  4. Shard routers

Correct Answer: 2

Explanation:

Config servers store persistent metadata required for managing a sharded MongoDB cluster. This metadata includes information about sharded collections, chunk placement, database ownership, and other cluster configuration details. In modern MongoDB deployments, config servers are normally deployed as a replica set to provide redundancy. mongos processes client requests and uses this metadata for routing, but it does not replace the config-server replica set as the persistent metadata store. Maintaining healthy config servers is therefore critical to the operational stability of a sharded environment.

Question 120

Which command can temporarily prevent a replica set member from becoming primary?

  1. rs.freeze()
  2. rs.pauseElection()
  3. rs.preventPrimary()
  4. rs.holdElection()

Correct Answer: 1

Explanation:

rs.freeze() can temporarily prevent a replica set member from becoming primary for a specified period. It is useful during controlled maintenance or topology management when an administrator wants to keep a particular member from winning an election. The command should be used carefully because replica-set elections are part of MongoDB’s high-availability mechanism. Administrators should understand the current primary, member health, priorities, and voting configuration before applying election-related controls. After the freeze period ends, normal election eligibility can resume according to the replica set’s configured rules.