ToolingRetrieval stores

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.

5 min read
In this article7
  1. What vector search in MongoDB actually does
  2. Index type, dimensions and query path
  3. Where it fits against dedicated vector stores
  4. Where its limits bite at scale
  5. Testing it against your own corpus
  6. Frequently asked questions
  7. Sources
An open rack server with its boards and cabling on a white table in a data centre.
An open rack server with its boards and cabling on a white table in a data centre.

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.

ProviderIndex methodsMaximum dimensionsWhere it runsLicence or entry price
ElasticsearchHNSW; float vectors indexed as int8_hnsw in Elastic Stack 9.04,096––
MongoDB Vector SearchHNSW (default), flat8,192Atlas; self-managed Community EditionAtlas Free $0; Flex up to $30 per month; Dedicated from $0.08 per hour
pgvectorHNSW, IVFFlat2,000 (vector type, indexed)PostgreSQL extension–
Pinecone––Fully managedStarter free; Standard $50 per month minimum usage
QdrantFilterable HNSW––Apache-2.0
WeaviateHNSW, 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.

Horizontal bars of the maximum dimensions of an indexed vector field: MongoDB Vector Search 8,192, Elasticsearch 4,096, pgvector 2,000. Pinecone, Qdrant and Weaviate state no maximum on the pages cited.
MongoDB Vector Search allows twice the vector dimensions of Elasticsearch's dense_vector field, per each provider's documentation on 11 November 2026.

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

  1. mongodb.com
  2. mongodb.com
  3. mongodb.com
  4. elastic.co
  5. mongodb.com
  6. github.com
  7. pinecone.io
  8. github.com
  9. github.com

Rankings and scores on Optinest cannot be bought — no commercial relationship changes how a provider is assessed. How we score

Related reading

All Tooling →