## TL;DR

$search and $vectorSearch need Atlas Search on a real Atlas cluster, or a local mongot sidecar on port 7027 for self-hosted setups.

## Fix

1. $search and $vectorSearch need Atlas Search on a real Atlas cluster, or a local mongot sidecar on port 7027 for self-hosted setups.
   Expected: you can confirm this matches your situation.

## When to use

- You are setting up or using this MongoDB Atlas Vector Search feature.
- The symptom matches: SearchNotEnabled / code 31082 on $vectorSearch.

## When NOT to use

- Unrelated MongoDB Atlas Vector Search issues (different feature, different failure).
- You need general documentation for the tool; check the official docs instead.

## Compatibility

Reported against MongoDB Atlas Vector Search. Source: a local/non-public address.com/jaewilson07/rag_mongodb.

## Variant phrasings

### SearchNotEnabled / code 31082 on $vectorSearch

## Why it happens

$vectorSearch fails with SearchNotEnabled (code 31082). Atlas Search is not available on the deployment the query is pointed at.

## Edge cases

- If your error message differs even slightly, this is probably a different issue; search the exact text.
- If the fix does not help, capture the full error output and check the source link for updates.

## Source

a local/non-public address.com/jaewilson07/rag_mongodb