MongoDB vector database: how Vector Search works, where it stops
MongoDB Vector Search keeps embeddings in the document and queries them with $vectorSearch. Index limits, filters, memory and a recall test, November 2026.
In this article7

What vector search in MongoDB actually does
MongoDB Vector Search finds documents whose embedding is closest to the embedding of a query. An embedding is a list of numbers that a model produces for a text, image or other input; similar inputs get nearby vectors. In MongoDB the embedding is an array field in the document, next to the fields the application already reads.
A search index of type vectorSearch indexes that field, and the $vectorSearch stage queries it inside an aggregation pipeline. The results can then pass through further stages such as $match.[1] The search runs in a separate process, mongot. On Atlas it runs on the cluster nodes or on dedicated Search Nodes. On self-managed Community Edition "you install and operate mongod and mongot yourself".[2]
Index type, dimensions and query path
A MongoDB vector index declares the field, its number of dimensions and its similarity function. The documentation sets the limit plainly: numDimensions must be "less than or equal to 8192". Similarity is euclidean, cosine or dotProduct, and quantization is none, scalar or binary. The indexingMethod is hnsw by default, or flat. Filter fields are declared in the same index definition.[3]
HNSW (Hierarchical Navigable Small Worlds) is a graph index that finds close vectors "without scanning every vector". That makes the search approximate (ANN). Setting exact to true switches to exact nearest neighbour search (ENN), which compares every indexed vector and "might negatively impact query latency". For ANN, numCandidates is required: it sets how many neighbours the search considers before it returns the top limit results.[1]
Where it fits against dedicated vector stores
MongoDB Vector Search fits when the documents and their embeddings belong together and the team already runs MongoDB. A dedicated vector store adds a second system, but its index options and limits differ. The table lists each provider's own documentation, read on 11 November 2026.
| Provider | Index methods | Maximum dimensions | Where it runs | Licence or entry price |
|---|---|---|---|---|
| Elasticsearch | HNSW; float vectors indexed as int8_hnsw in Elastic Stack 9.0 | 4,096 | – | – |
| MongoDB Vector Search | HNSW (default), flat | 8,192 | Atlas; self-managed Community Edition | Atlas Free $0; Flex up to $30 per month; Dedicated from $0.08 per hour |
| pgvector | HNSW, IVFFlat | 2,000 (vector type, indexed) | PostgreSQL extension | – |
| Pinecone | – | – | Fully managed | Starter free; Standard $50 per month minimum usage |
| Qdrant | Filterable HNSW | – | – | Apache-2.0 |
| Weaviate | HNSW, flat, dynamic, HFresh | – | – | BSD-3-Clause |
A "–" means the provider's page cited here lists no value.[4][5][6][7][8][9]
The table compares documented limits, not performance. A feature list is not a comparison of recall or latency on a given corpus; only a test on that corpus is.

Where its limits bite at scale
The first limit is recall. MongoDB calls 90 to 95 percent overlap with ENN results "optimal recall" for ANN. It recommends a numCandidates value "at least 20 times higher" than limit, for example 100 candidates for 5 results. More candidates raise recall and latency together.[1]
The second is filtering. A pre-filter works only on fields declared as filter fields in the index. MongoDB states that "filtered queries are typically slower than an otherwise equivalent unfiltered query". Filters also run per index segment, each with its own HNSW graph.[1]
The third is memory. For production on Atlas, MongoDB lists an M10 or higher cluster with separate Search Nodes at the S30 tier or above. Quantization cuts the RAM that vectors use on mongot by 3.75x with scalar and 24x with binary quantization. Atlas still keeps full-precision vectors on disk for ENN and rescoring, so MongoDB suggests roughly 4:1 storage to RAM for scalar and 24:1 for binary.[2] Dedicated Atlas clusters start at $0.08 per hour, and the M10 tier at $56.94 per month, as listed on 11 November 2026.[5]
Testing it against your own corpus
The test that settles the choice compares ANN against ENN on the team's own documents. Take a sample of real queries and run each with exact set to true, then as ANN with the planned numCandidates. Measure the overlap of the top results against MongoDB's 90 to 95 percent mark, and the latency of both.[1]
Repeat the run with the filters the application will use, and with the quantization the budget allows. A filter that is not declared in the index has to move into a $match stage after the search. Then size the Search Nodes against the measured index size. Tools for structured evaluation runs are compared in LLM testing framework: Matching tools to evaluations. The serving side of a retrieval stack is covered in Comparing LLM Inference Frameworks: vLLM, SGLang and Ray and LLM orchestration framework: comparing tools and platforms.
Frequently asked questions
Is MongoDB a vector database?
MongoDB is a document database with a vector index. MongoDB Vector Search stores embeddings as a field in ordinary documents and queries them with the $vectorSearch stage, so one system holds both the data and its vectors.
Can I run MongoDB Vector Search outside Atlas?
Yes. MongoDB's deployment documentation lists self-managed Community Edition, where the operator installs and runs mongod and mongot on their own hardware or cloud instances.
How many dimensions does MongoDB Vector Search support?
A vector field can hold up to 8,192 dimensions, according to MongoDB's index documentation. Elasticsearch's dense_vector field allows up to 4,096 dimensions.
What does MongoDB Vector Search cost on Atlas?
Vector Search runs on the Atlas cluster tiers. MongoDB lists Free at $0, Flex at $0.011 per hour up to $30 per month, and Dedicated clusters from $0.08 per hour, with M10 at $56.94 per month, as of 11 November 2026. Separate Search Nodes for production are an additional tier.
Sources
Rankings and scores on Optinest cannot be bought — no commercial relationship changes how a provider is assessed. How we score
Related reading
All Tooling →Air cooling data centers: where it works and where it stops
Air cooling data centers: the measured rack-density limits, ASHRAE temperature classes and the criteria for choosing air, hybrid or liquid cooling.

Serverless vs dedicated inference cost: where the curves cross
Serverless vs dedicated inference cost as a model with named variables, and which European providers sell each mode. Read 26 October 2026.

Do I need 32GB RAM for AI? It depends where the weights sit
Do I need 32GB RAM for AI? When system RAM must hold weights and KV cache, published model footprints, and how to size memory from them.
