MongoDB Associate Developer study materials
MongoDB Associate Developer study resources

MongoDB Associate Developer key terms

MongoDB Associate Developer · Get comfortable with the vocabulary.

Document

A single record in MongoDB, stored as a set of field-and-value pairs in BSON. Documents are the basic unit of data and live inside collections; different documents in one collection may have different fields.

Related: Collection, BSON
Collection

A grouping of documents inside a database, roughly like a table in a relational system. Collections do not enforce a fixed schema by default, and each document is stored and queried independently.

Related: Document, BSON
BSON

Binary JSON, the encoded format MongoDB uses to store and transfer documents. It extends JSON with extra types such as dates, 64-bit integers, binary data and ObjectId while remaining fast to scan and parse.

Related: Document, ObjectId
ObjectId

A 12-byte BSON value used as the default _id, combining a timestamp, a per-process random value and a counter. It is roughly ordered by creation time and can be generated by drivers without server coordination.

Related: BSON, Document
Replica set

A group of mongod processes that keep identical copies of the same data. One node is primary and accepts writes; secondaries replicate the primary's oplog and can take over if the primary fails.

Related: Write concern, Read preference
Shard key

One or more indexed fields that determine how documents are distributed across shards in a sharded cluster. Choosing a key with high cardinality and even write distribution avoids hot shards and slow scatter-gather queries.

Related: Compound index, Replica set
insertMany

A write operation that inserts an array of documents in a single call, optionally ordered or unordered. Unordered inserts continue past errors, which is useful for bulk loading when some documents may fail.

Related: Write concern, Query filter
Query filter

The document passed to find, update or delete methods that specifies which documents match. It uses field conditions plus operators such as $gt, $in and $exists; an empty filter matches every document.

Related: Projection, Cursor
Projection

The second argument to find that lists which fields to return or suppress. Including a field also includes _id by default, and inclusion and exclusion fields cannot be mixed except for _id.

Related: Query filter, Covered query
Upsert

An update option that inserts a new document built from the filter and update when no document matches. It prevents race conditions in read-then-write code and works best alongside a unique index.

Related: Unique index, Query filter
$set

An update operator that assigns new values to listed fields, creating them if absent, while leaving other fields untouched. It is the usual choice for partial updates instead of replacing a whole document.

Related: Query filter, Upsert
deleteMany

A delete operation that removes every document matching the filter and reports the count removed. Passing an empty filter deletes all documents but keeps the collection and its indexes.

Related: Query filter, insertMany
Cursor

A pointer to the result set of a query, returned by find so documents can be fetched in batches. Drivers expose iteration methods, and cursors expire server-side if left idle too long.

Related: Query filter, Projection
Compound index

An index on two or more fields in a defined order. It can support queries on a prefix of its fields, and field order matters for both matching and sort performance.

Related: ESR rule, Covered query
ESR rule

A guideline for ordering fields in a compound index: Equality fields first, then Sort fields, then Range fields. Following it lets one index satisfy filters, sorting and range bounds in a single scan.

Related: Compound index, Query filter
Covered query

A query whose filter and returned fields all appear in one index, so the server answers it from the index alone without fetching the full document. Covered queries avoid extra document reads.

Related: Compound index, Projection
Multikey index

An index built on a field that holds an array, where MongoDB creates one index entry per array element. Multikey indexes serve queries on array elements but cannot cover a query on the array itself.

Related: Compound index, $unwind
TTL index

A single-field index on a date or date array with expireAfterSeconds set, which makes a background process delete documents once they age past the threshold. It is used for sessions, logs and cached data.

Related: Compound index, Document
Unique index

An index that rejects duplicate values for the indexed field combination, enforcing uniqueness at the storage layer. It also lets update operations with upsert run safely under concurrency.

Related: Compound index, Upsert
explain()

A command that returns the query plan chosen for a read or write, including the winning plan, index usage and, with executionStats, documents and keys examined. It is the main tool for diagnosing slow queries.

Related: Compound index, Covered query
Aggregation pipeline

An ordered sequence of stages that transform documents, where each stage passes its output to the next. Stages can filter, group, reshape, join and compute, and the server optimizes the pipeline as a whole.

Related: $match, $group
$match

A pipeline stage that filters documents by a query expression, like find's filter. Placed early, it reduces the number of documents later stages must process and can make use of indexes.

Related: Aggregation pipeline, $group
$group

A pipeline stage that collects documents into groups by an _id expression and computes values with accumulators such as $sum, $avg and $push. It outputs one document per distinct group key.

Related: $match, $unwind
$lookup

A pipeline stage that performs a left outer join with another collection in the same database, matching local fields to foreign fields. Results arrive as an array field, and performance depends on indexing the foreign field.

Related: Referencing, $unwind
$unwind

A pipeline stage that turns a document containing an array into one document per array element, copying the other fields. It is commonly used before grouping on values stored inside arrays.

Related: $group, Multikey index
Embedding

Storing related data as nested subdocuments or arrays inside a single document. It gives fast single-read access to related data but works best when the embedded data is bounded and read together.

Related: Referencing, Bucket pattern
Referencing

Storing related data in a separate collection and linking it by an identifier field. This avoids duplication for shared or unbounded data, at the cost of extra queries or $lookup joins.

Related: Embedding, $lookup
Bucket pattern

A schema design that groups many small, time-ordered items into a few documents covering a period or a count. It reduces document count and index size for high-volume series data.

Related: Embedding, Document
Schema validation

Collection-level rules, expressed with $jsonSchema or query operators, that reject inserts and updates violating the declared shape. Validation is optional and does not change how documents are stored.

Related: Document, Embedding
Transaction

A set of reads and writes across one or more documents and collections that commit together or abort entirely. Multi-document transactions require a replica set or sharded cluster and add overhead.

Related: Session, Snapshot isolation
Session

A server-side context that groups operations, carries causal consistency information and is required to start transactions in drivers. Sessions are obtained from the client and should be ended when finished.

Related: Transaction, Write concern
Snapshot isolation

The isolation level used by MongoDB transactions, where every read in the transaction sees the same consistent snapshot of the data. It prevents dirty reads and non-repeatable reads within the transaction.

Related: Transaction, Session
Write concern

A setting that says how many nodes must acknowledge a write before the driver reports success, from w:1 up to majority. Higher levels trade latency for durability across replica set failover.

Related: Replica set, Read preference
Read preference

A driver setting that chooses which replica set members may serve reads, such as primary, primaryPreferred, secondary or nearest. Secondary reads may return stale data because replication is asynchronous.

Related: Replica set, Write concern
Connection pool

A driver-managed cache of open connections to the server that operations borrow and return. Sizing maxPoolSize to the workload and server limits avoids connection storms and queuing latency.

Related: Read preference, Write concern
Atlas cluster

A managed MongoDB deployment hosted by MongoDB Atlas, offered in shared, dedicated and serverless tiers. Atlas handles provisioning, backups, monitoring and upgrades for replica sets and sharded clusters.

Related: SRV connection string, Connection pool
mongosh

The interactive MongoDB shell, a Node.js-based command line client for running queries, aggregations and administrative commands. It supports JavaScript, autocompletion and connection strings for local or Atlas deployments.

Related: Atlas cluster, MongoDB Compass
MongoDB Compass

The official graphical client for exploring databases, running queries, building aggregation pipelines visually and inspecting indexes and inferred schema. It connects with the same connection strings as drivers.

Related: mongosh, Aggregation pipeline
SRV connection string

A mongodb+srv:// URI whose host name points to DNS SRV records listing the cluster members. Drivers discover nodes automatically, and TLS is enabled by default for Atlas clusters.

Related: Atlas cluster, Connection pool