Docs Menu
Docs Home
/
MongoDB Atlas
/

Troubleshooting

On this page

  • Cannot use the $vectorSearch stage on Atlas cluster
  • In Atlas, go to the Clusters page for your project.
  • Slow queries
  • $vectorSearch returns no results
  • Error during document retrieval when using filtering with LangChain
  • Command not found when creating Atlas Vector Search index
  • Unable to filter on a given field

This document provides advice for troubleshooting problems with Atlas Vector Search. For direct assistance with Atlas Vector Search issues, you can either start a discussion on the MongoDB Developer Community or contact support.

To use the $vectorSearch pipeline stage to query your cluster, your cluster must run MongoDB 6.0.11+ or 7.0.2+. If you invoke $vectorSearch on an incompatible version of MongoDB, you might see the following error:

OperationFailure: $vectorSearch is not allowed with the current
configuration. You may need to enable the corresponding feature
flag.

To check the MongoDB version of your cluster:

1
  1. If it's not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

  3. If it's not already displayed, click Clusters in the sidebar.

    The Clusters page displays.

2

Locate the information pane of the cluster you want to use $vectorSearch on.

3

Consult the Version number in the bottom section of the information pane.

If your cluster runs a version of MongoDB earlier than 6.0.11 or 7.0.2, you must upgrade the MongoDB version of the cluster.

For recommendations on improving query performance, see Improve Vector Search Performance.

If $vectorSearch queries return no results, ensure that you use the same text embedding model to embed both your data and your query. If you embed your query using a different model than you use to embed your data, $vectorSearch can't identify matches.

When you use LangChain to perform RAG with pre-filtering, you might encounter the following error:

Error during the document retrieval or generation process:
MongoServerError: PlanExecutor error during aggregation :: caused
by :: Path 'field' needs to be indexed as token

If an index on field exists, ensure you have created this index as an Atlas Vector Search index, not an Atlas Search index. If no index on field exists, create one. To learn more about implementing RAG with Atlas Vector Search and LangChain, see Answer Questions on Your Data.

When you attempt to create an Atlas Vector Search index programmatically, you might encounter a Command not found error. This error occurs for one of two reasons:

Atlas Vector Search currently supports filtering only on fields with boolean, numeric, or string values.

Back

Improve Performance