MongoDB vocabulary: Journeyman level

44 MongoDB terms at the Journeyman level, each with a short definition and a link to its full page.

Updated

Study these as flash cards

$dateToString
A pipeline expression that writes a date as text in the format you give, such as "%Y-%m" for 2026-03, optionally on a named time zone's clock.
$elemMatch
A filter operator on an array field that matches only when one item meets every condition inside it.
$group
The aggregation stage that groups documents and computes totals.
$jsonSchema
The validator operator that describes the shape a document must have: required fields, and each field's bsonType, minimum or allowed values (enum).
$lookup
The aggregation stage that joins in documents from another collection.
$match
The aggregation stage that filters documents.
$project
An aggregation stage that keeps only the fields it names, and can rename a field or leave out _id, such as category set to "$_id" with _id set to 0.
$set and $addFields
Two names for one aggregation stage that adds a computed field to each document, or replaces one, and keeps every other field.
$setOnInsert
An update operator that sets its fields only when an upsert inserts a new document, so a later save never resets them.
$text
A query operator that searches a collection's text index for the words given in $search, in any case.
$type
A filter operator that matches a field by the kind of value it holds, such as "string" or "number", which finds a number typed in as text.
$unwind
Splits a document into one per array element.
Accumulator
An operator in a $group stage that collects one value from every document in a group and turns them into one answer, such as $sum, $avg, $min, $max or $first.
Aggregation Expression
A small formula a pipeline stage works out for each document, such as $multiply to multiply numbers or $round to keep two decimal places.
Aggregation Pipeline
A series of stages that filter, reshape and summarize documents.
Aggregation Stage
One step of an aggregation pipeline, written as a document whose one field names its job, such as { $match: { category: "bikes" } }; it works on what the stage before it handed on.
Collection Scan
Reading every document in a collection to check it against a query's filter, which is what a query does when no index fits.
Compound Index
An index on several fields, used from the leftmost field.
Computed Pattern
Working a number out once, when the data is written, and storing it, such as a review count and a star total kept with $inc, instead of on every read.
createIndex
The method that builds an index on the fields you name, such as { customerId: 1 }, and answers with the new index's name.
Data Modeling in MongoDB
Shaping documents around how the app reads data.
Decimal128
The BSON type for an exact decimal number, used for money; written NumberDecimal("0.60") in mongosh.
Document Size Limit
The most one MongoDB document can hold, 16 MB; a write that would make a document bigger is refused.
Extended Reference Pattern
Keeping another document's _id together with a copy of the few fields a page shows with it, such as an order item with the product's name and the price paid.
Field Path
A field name in quotes with a dollar sign in front, such as "$total" (read "dollar total"), meaning the value of that field in each document.
Filter Builder
The C# driver's Builders<T>.Filter, which builds a MongoDB filter one condition at a time, such as Eq for an exact value and Lte for less than or equal to.
findOneAndUpdate
Changes one document and gives it back, as it was before the change or, with returnDocument "after", as it is now.
Index in MongoDB
Makes queries on a field fast instead of scanning everything.
IP Access List
Atlas's list of the addresses allowed to connect to a cluster at all; 0.0.0.0/0 on it means every address.
lean()
A Mongoose query option that gives back plain objects instead of Mongoose documents, which is lighter for code that only reads.
MongoDB Driver
The official library for using MongoDB from a programming language.
Mongoose
A Node.js library adding schemas and models on top of MongoDB.
Mongoose Model
The object Mongoose makes from a schema with mongoose.model, which saves and finds that kind of document in its collection with create, find and findById.
Mongoose Schema
The description of one kind of document in Mongoose: each field, its type and its rules, such as required or a minimum, checked before every save.
Object Document Mapper (ODM)
A library, such as Mongoose, that maps your program's objects to database documents and back, with a schema that describes and checks each kind of document.
One-to-Few Relationship
A link from one document to a small, limited number of others, such as a bike and its few photos; usually embedded.
Polymorphic Pattern
Keeping documents of different shapes in one collection, with shared fields, each kind's own fields and a type field to tell them apart, such as bikes, helmets and lights.
populate
A Mongoose method that swaps a stored reference, such as a pet's _id, for the document it points to, by sending a second query from your app.
Schema Validation
Rules that make MongoDB reject documents with the wrong shape.
Soft Delete
Marking a document as removed, often with archived set to true, instead of deleting it, so it can be hidden now and brought back later.
Subset Pattern
Keeping only the few items of a growing list that a page shows, such as a product's five newest reviews, inside the document, with the whole list in its own collection.
Text Index
An index on a collection's text fields that lets $text search them for whole words, in any case and form; one per collection.
Unbounded Array
An array inside a document that keeps growing for as long as the app runs, such as every page view of a product; a modeling mistake.
Upsert
Update if it exists, insert if it doesn't.

Every MongoDB term, by level