Dynamic mapping automatically indexes all supported fields that Atlas Search discovers in collection documents, making search setup convenient as schemas evolve. section 11.3.3
Choose dynamic mapping with these trade-offs in mind:
- Use it for quick setup, testing, or collections whose searchable fields change frequently. section 11.3.3 section 13.5.1
- Expect higher disk usage and possible cluster-performance impact because every dynamically indexable field is indexed. section 11.3.3
- Prefer static mappings for production when selective indexing, efficient storage, or tighter type control matters. section 11.3.3 section 11.8
Manage the setting with Atlas Search index commands:
- Create an index with `{ "mappings": { "dynamic": true } }`. section 11.6
- Inspect configurations with `getSearchIndex()` or `getSearchIndexes()`. section 11.6 section 13.5.1
- Change an existing index to static mappings with `updateSearchIndex()`, or remove it with `dropSearchIndex()`. section 11.6
Local test index
Create `LocalSearchIndex` on the `inspections` collection with `{ mappings: { dynamic: true } }`, verify that it is READY and queryable, then drop it when testing ends. section 13.5.1
Listing 11.1 Atlas Search index syntax
{
"analyzer": "<analyzer-for-index>",
"searchAnalyzer": "<analyzer-for-query>",
"mappings": {
"dynamic": <boolean>,
"fields": { <field-definition> }
},
"analyzers": [ <custom-analyzer> ],
"storedSource": <boolean> | {
<stored-source-definition>
},
"synonyms": [
{
"name": "<synonym-mapping-name>",
"source": {
"collection": "<source-collection-name>"
},
"analyzer": "<synonym-mapping-analyzer>"
}
]
}
Review the complete Atlas Search index definition shape, including `mappings.dynamic`, field definitions, analyzers, stored sources, and synonyms. section 11.3.3

