MongoDB vocabulary

110 MongoDB terms, from Novice to Master. Start with the basics or jump to a level.

Updated

Novice

_id and ObjectId
Every document's unique _id, by default an auto-generated ObjectId.
BSON
MongoDB's binary form of JSON with extra types like dates.
Collection in MongoDB
A group of documents, created on first insert.
Document in MongoDB
A JSON-like record in MongoDB with a unique _id.
Field
One named detail of a document, written as its name, a colon and its value, such as minutes: 25.
MongoDB
The most popular document database.
MongoDB Atlas
MongoDB's managed cloud service, with a free tier.
MongoDB Compass
MongoDB's desktop app for browsing and querying data.
mongosh
The MongoDB command-line shell.

Apprentice

$addToSet
An update operator that adds an item to an array only when the array doesn't hold it yet, such as a favorite tapped twice.
$all
A filter operator that matches an array holding every value in a list, in any order, with other items allowed.
$count
An aggregation stage that counts the documents reaching it and hands on one document holding that number, in a field you name, such as { orders: 197 }.
$exists
A filter operator that matches by whether a field is in the document at all, whatever it holds, null included.
$in
A filter operator that matches a field equal to any value in a list, such as a cuisine that is Thai, Japanese or Korean.
$inc
An update operator that adds a number to a field inside the database, or subtracts with a negative one, so no count is lost; a missing field counts as 0.
$push and $pull
Update operators for an array: $push adds an item to the end, even one already there, and $pull removes every item equal to a value.
$size
A filter operator that matches an array with exactly the given number of items.
$unset
An update operator that takes a field out of a document altogether, such as a featured flag when the month is over.
Array Field
A field holding a list, queried and updated with array operators.
Cluster
Atlas's word for a MongoDB it runs for you in the cloud: a small group of servers that keep your data, with copies, and answer your queries.
Comparison Operators
$gt, $gte, $lt, $lte, $ne, $in and $nin: filter operators that compare a field with a value or a list, such as minutes under 30.
Connection String
The one-line address of a MongoDB, such as mongodb://localhost:27017 on your own computer, or a mongodb+srv address with a user name and password for Atlas.
countDocuments
Counts the documents that match a filter, without sending them, such as the total beside one page of results.
Cursor
What find gives back: a pointer into the matching documents that hands them over a batch at a time; mongosh shows 20, and typing it shows more.
Database in MongoDB
A named group of collections.
Database User
A name and password a program signs in to a database with, separate from the account you use on the database's website.
deleteOne and deleteMany
Remove one or all matching documents.
Document Reference
A field that holds another document's _id to link the two, such as customerId in an order pointing at its customer.
Dot Notation
A field name such as "nutrition.calories", in quotes, that reaches a field inside an embedded document or inside each item of an array of documents.
drop()
Removes a whole collection, its documents and the collection itself, where deleteMany with an empty filter leaves it there empty.
Duplicate Key Error
The E11000 error MongoDB gives when a write would put a second document with the same _id, or another value that must be unique, into a collection.
Embedded Document
An object stored inside another document.
find
Returns the documents that match a filter.
findOne
Gives back the first document that matches a filter, as one document rather than a list, or null when none matches.
insertOne and insertMany
Add one or several documents to a collection.
ISODate
mongosh's way to write a date, such as ISODate("2026-01-24"), stored as a BSON date that sorts and compares by time.
Logical Operators
$and, $or, $not and $nor: filter operators that combine conditions, or flip one and rule it out.
MongoClient
The official Node.js driver's connection to a MongoDB server, made from a connection string; db() and collection() pick where the data goes, and close() hangs up.
null
A value meaning no value; in a filter, { field: null } matches a field that holds null and a field that is missing altogether.
Projection
Chooses which fields a query returns.
Query Filter
An object describing which documents to match.
Query Operators
$-prefixed conditions like $gt, $in and $or.
replaceOne
Swaps a whole document for a new version you give it; every field the new version leaves out is gone, and the _id stays.
sort, limit and skip
Order results, cap them, and skip some for paging.
Update Operators
$-prefixed instructions such as $set, $inc, $push and $pull that change parts of a document in place, in one step.
updateMany
Changes every document that matches a filter, with an update operator such as $set saying what changes.
updateOne and $set
Change a matching document; $set updates just the given fields.

Journeyman

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

Freelancer

Atlas Search
Full-text search built into MongoDB Atlas.
Change Streams
A real-time feed of changes to a collection.
collMod
The command that changes a collection that already exists, such as giving it a validator: db.runCommand({ collMod: "products", validator: ... }).
ESR Rule
The order for a compound index's fields: the fields matched exactly (equality) first, then the field you sort by, then the fields with a range.
executionStats
The part of explain's report that counts a query's work: nReturned, totalKeysExamined, totalDocsExamined and executionTimeMillis.
explain()
Shows how a query ran and whether it used an index.
Index Prefix
The first field, or first few fields, of a compound index; the index serves a query on its prefix, but not one on a later field alone.
NoSQL Injection
An attack that sends a query operator, such as { "$gt": "" }, where the API expects text, so the database runs a filter the attacker chose.
Read Preference
Which servers a query may read from.
Replica Set
A group of servers holding copies of the data, with automatic failover.
Shard Key
The field that decides which shard stores each document.
Sharded Cluster
MongoDB split across several shards for scale.
Transactions in MongoDB
Several document changes that succeed or fail together.
validationLevel and validationAction
A collection's two validation settings: validationLevel decides which writes are checked (strict or moderate), and validationAction what happens to a bad one (error or warn).
Write Concern
How many servers must confirm a write before it counts.

Master

Atlas Vector Search
Similarity search over embeddings inside MongoDB Atlas.
Oplog
The log of writes that secondaries replay to stay in sync.
Schema Design Patterns
Proven document shapes for common needs, like bucket and subset.
WiredTiger
MongoDB's storage engine.

More subjects in Databases