MongoDB C100DBA Practice Test Questions and Exam Dumps Part17 Q321-340

View Full MongoDB C100DBA Exam Dumps and Practice Test Dumps

 

Question 321

Which utility restores data created by mongodump?

  1. mongoload
  2. mongorecover
  3. mongorebuild
  4. mongorestore

Correct Answer: 4

Explanation:

The mongorestore utility restores BSON data produced by mongodump. It can restore an entire database, selected collections, or specific backup content depending on the supplied options. Administrators commonly use it for database recovery, migrations, development environments, and test restoration procedures. mongorestore can also work with archive and compression formats generated by compatible mongodump operations. A backup strategy should always include restoration testing so administrators know that stored backup data can actually be recovered. mongoload, mongorecover, and mongorebuild are not standard MongoDB utilities for restoring mongodump output.

Question 322

Which utility exports documents as JSON or CSV?

  1. mongoextract
  2. mongoexport
  3. mongodata
  4. mongocsv

Correct Answer: 2

Explanation:

The mongoexport utility creates a JSON or CSV representation of documents from a MongoDB collection. It is useful when data needs to be transferred into systems that expect structured text formats or when a human-readable export is required. It differs from mongodump, which creates BSON-oriented backup data intended for restoration with MongoDB tools. mongoexport is generally intended for data interchange rather than serving as a complete backup strategy. mongoextract, mongodata, and mongocsv are not the standard MongoDB utility names for exporting collection documents.

Question 323

Which utility imports JSON or CSV into MongoDB?

  1. mongoimport
  2. mongoload
  3. mongoinsert
  4. mongoread

Correct Answer: 1

Explanation:

The mongoimport utility loads data from JSON, CSV, or TSV files into a MongoDB collection. It is commonly used when migrating structured data from external systems, loading test datasets, or reversing an export created with mongoexport. The import behavior can be controlled with options that determine formats, fields, and insertion or replacement behavior. Administrators should validate imported data and consider indexes and validation rules when loading production collections. mongoload, mongoinsert, and mongoread are not the standard MongoDB command-line utility names for importing external data.

Question 324

Which backup method can capture changes from the oplog?

  1. Collection export
  2. Oplog-based backup
  3. Index snapshot
  4. Schema archive

Correct Answer: 2

Explanation:

An oplog-based backup approach uses MongoDB’s replication operation log to capture changes that occur after a suitable base backup. The oplog records operations that can be used to reproduce changes on a replica-set deployment. Combining a base backup with subsequent oplog information can support recovery to a particular point within the available oplog history. Administrators must ensure that the required oplog entries remain available for the intended recovery window. Collection exports and index snapshots do not provide the same mechanism for replaying replica-set operations.

Question 325

Which aggregation stage performs a proximity search using geospatial data?

  1. $geoNear
  2. $nearSearch
  3. $distance
  4. $geoFind

Correct Answer: 1

Explanation:

The $geoNear aggregation stage performs a geospatial query that calculates distances from a specified point and returns documents ordered by proximity. It is commonly used for applications such as nearby-store searches, location services, and distance-based recommendations. The stage works with appropriate geospatial indexes and supports options for controlling the search criteria and calculated distance field. Because $geoNear has specific pipeline-placement and indexing requirements, administrators should review those requirements when designing geospatial aggregations. $nearSearch, $distance, and $geoFind are not MongoDB aggregation stages with this function.

Question 326

Which aggregation stage calculates values across ordered documents?

  1. $windowCalc
  2. $setWindowFields
  3. $windowGroup
  4. $orderedFields

Correct Answer: 2

Explanation:

The $setWindowFields aggregation stage performs calculations over a defined window of documents. It can partition documents into groups, establish an ordering, and calculate window-based results such as ranks, moving values, and cumulative calculations. This makes it useful for analytical workloads where the result for one document depends on neighboring or related documents. The stage provides more specialized analytical behavior than ordinary grouping. $windowCalc, $windowGroup, and $orderedFields are not standard MongoDB aggregation stages for window calculations.

Question 327

Which window function assigns ranking with gaps after ties?

  1. $rank
  2. $sequenceRank
  3. $orderedRank
  4. $positionRank

Correct Answer: 1

Explanation:

The $rank window function assigns ranks based on the ordering of documents and gives tied values the same rank. When ties occur, subsequent ranks contain gaps. For example, if two documents share rank 1, the next distinct value receives rank 3. This behavior differs from functions that produce consecutive ranking values after ties. $rank is used within $setWindowFields for analytical ranking operations. $sequenceRank, $orderedRank, and $positionRank are not standard MongoDB window function names.

Question 328

Which window function gives consecutive ranks for tied values?

  1. $continuousRank
  2. $denseRank
  3. $compactRank
  4. $groupRank

Correct Answer: 2

Explanation:

The $denseRank window function assigns equal values the same rank while avoiding gaps between ranking groups. For example, if two records share rank 1, the next distinct value receives rank 2 rather than rank 3. This makes dense ranking useful when an application wants a compact sequence of ranking positions. It is available through MongoDB’s window-function capabilities and is generally used within $setWindowFields. $continuousRank, $compactRank, and $groupRank are not the MongoDB function names for this ranking behavior.

Question 329

Which window function assigns a unique sequential number to each document?

  1. $documentNumber
  2. $rowSequence
  3. $sequenceNumber
  4. $recordNumber

Correct Answer: 1

Explanation:

The $documentNumber window function assigns a sequential number to each document according to the ordering defined in the window specification. Unlike ranking functions, it does not assign the same number to tied values; each document receives its own position in the ordered sequence. This makes it useful for generating row-like numbering within partitions. It is commonly used with $setWindowFields when analytical output needs an explicit sequence. $rowSequence, $sequenceNumber, and $recordNumber are not the corresponding MongoDB window function names.

Question 330

Which stage groups documents by an expression and sorts by count?

  1. $countByGroup
  2. $groupCount
  3. $sortByCount
  4. $frequencySort

Correct Answer: 3

Explanation:

The $sortByCount aggregation stage groups documents according to an expression and then sorts the resulting groups by their document counts in descending order. It provides a concise way to answer questions such as which category, tag, or value appears most frequently. Internally, its behavior is similar to grouping followed by sorting on the calculated count. $sortByCount is particularly useful for frequency analysis and exploratory aggregation. $countByGroup, $groupCount, and $frequencySort are not standard MongoDB aggregation stage names.

Question 331

Which accumulator returns the top N values according to a sort specification?

  1. $topN
  2. $highestN
  3. $maxNValues
  4. $bestN

Correct Answer: 1

Explanation:

The $topN accumulator returns the top N documents or values according to a specified sort order. It can be used in aggregation workloads where applications need more than a single maximum result, such as the highest-performing products or leading scores within groups. The accumulator supports a sorting definition and an n value that determines how many results are retained. It is useful when ordinary $max is insufficient because multiple top results are required. $highestN, $maxNValues, and $bestN are not the standard MongoDB accumulator names.

Question 332

Which accumulator calculates a median value?

  1. $middle
  2. $median
  3. $centerValue
  4. $midpoint

Correct Answer: 2

Explanation:

The $median accumulator calculates an approximate median for a set of numeric values using percentile-based processing. The median represents the central point of an ordered distribution, where approximately half the observations are below and half are above the result. Median calculations are useful for analyzing measurements such as response times, transaction amounts, or other skewed datasets where an average may not represent the typical value well. $middle, $centerValue, and $midpoint are not MongoDB aggregation accumulator names for calculating a median.

Question 333

Which accumulator estimates specified distribution percentiles?

  1. $percentile
  2. $distribution
  3. $quantileValue
  4. $percentileRange

Correct Answer: 1

Explanation:

The $percentile accumulator calculates approximate percentile values for a set of numeric observations. Percentiles are useful for understanding the distribution of measurements, such as identifying the value below which 95 percent of response times fall. MongoDB can calculate multiple requested percentile positions as part of an aggregation. This is particularly useful for operational and analytical reporting where averages alone do not adequately describe the distribution. $distribution, $quantileValue, and $percentileRange are not the standard MongoDB aggregation accumulator names for this purpose.

Question 334

Which stage replaces the current document with a generated document?

  1. $swapRoot
  2. $changeRoot
  3. $replaceWith
  4. $newDocument

Correct Answer: 3

Explanation:

The $replaceWith aggregation stage replaces the input document with a specified expression’s result. It is useful when the desired output should have a completely different document structure, such as promoting a nested document to the top level. The expression supplied to $replaceWith determines the new document that enters the next pipeline stage. This differs from selectively adding or modifying fields because the resulting document becomes the pipeline’s current document. $swapRoot, $changeRoot, and $newDocument are not standard MongoDB aggregation stage names.

Question 335

Which stage generates missing time-series measurements?

  1. $expandSeries
  2. $densify
  3. $fillGaps
  4. $generatePoints

Correct Answer: 2

Explanation:

The $densify aggregation stage creates documents for missing values in a sequence according to specified bounds and spacing. It is particularly useful with time-series or ordered numerical data where observations may be missing from an otherwise regular interval. After densifying a sequence, another stage can be used to populate calculated values where appropriate. This can simplify analytical pipelines that require regular time intervals. $expandSeries, $fillGaps, and $generatePoints are not MongoDB aggregation stage names for generating missing sequence points.

Question 336

Which aggregation stage explicitly supplies documents as pipeline input?

  1. $documents
  2. $inputDocs
  3. $literalDocuments
  4. $seedData

Correct Answer: 1

Explanation:

The $documents aggregation stage allows a pipeline to begin with explicitly supplied documents rather than reading them from a normal collection. This can be useful for generating small datasets directly within an aggregation pipeline, testing pipeline expressions, or combining supplied documents with subsequent aggregation logic. Because the stage provides the pipeline’s input documents directly, it has different behavior from stages that transform documents obtained from a collection. $inputDocs, $literalDocuments, and $seedData are not standard MongoDB aggregation stage names.

Question 337

Which query operator represents the natural record order?

  1. $physicalOrder
  2. $natural
  3. $storageOrder
  4. $recordSequence

Correct Answer: 2

Explanation:

The $natural query operator allows MongoDB to access documents according to their natural storage order rather than selecting a conventional index ordering. It can be used with sorting to request natural ascending or descending order. Natural order should not be treated as a stable logical ordering for application-level results because storage behavior can change as documents are inserted, updated, moved, or otherwise managed. It is mainly useful for specific administrative or performance-related cases. $physicalOrder, $storageOrder, and $recordSequence are not MongoDB query operators for natural document ordering.

Question 338

Which aggregation stage removes fields based on conditional logic?

  1. $filterFields
  2. $redact
  3. $hideFields
  4. $maskFields

Correct Answer: 2

Explanation:

The $redact aggregation stage can conditionally restrict or remove portions of documents based on expressions evaluated against the document structure. It is useful when an aggregation pipeline needs to apply document-level or field-level visibility rules dynamically. $redact works with special system variables that determine whether a portion of a document should be retained, descended into, or removed. This differs from simple projection, which explicitly selects or excludes fields without the same recursive conditional behavior. $filterFields, $hideFields, and $maskFields are not MongoDB aggregation stage names.

Question 339

Which backup approach uses filesystem snapshots?

  1. Logical export
  2. Collection dump
  3. Filesystem snapshot
  4. Document archive

Correct Answer: 3

Explanation:

A filesystem snapshot captures the storage files underlying a MongoDB deployment at a particular point in time. When used correctly with MongoDB’s storage and consistency requirements, filesystem snapshots can provide a fast mechanism for creating large-scale backups. Snapshot-based backup procedures must account for replica-set state, write activity, storage configuration, and the requirements of the selected filesystem or cloud provider. They differ from logical tools such as mongodump, which process database documents individually. A filesystem snapshot is therefore a storage-level backup method rather than a document export.

Question 340

Which backup characteristic supports recovery to a selected time?

  1. Point-in-time recovery
  2. Instant document replay
  3. Exact query recovery
  4. Schema-time restore

Correct Answer: 1

Explanation:

Point-in-time recovery allows a MongoDB deployment to be restored to a selected moment within the available recovery window. This capability is particularly valuable when an unwanted change, accidental deletion, or application error occurs and the desired recovery target is not simply the latest backup. Point-in-time recovery commonly depends on a suitable base backup combined with subsequent operation history or a backup system that preserves continuous recovery information. The achievable recovery point depends on the configured backup architecture and retained data. The other terms are not standard MongoDB recovery concepts.