<!-- llms-explorer concept facts · https://llms-explorer.com/tree/cosmos-db-for-mongodb-wildcard-differences/ · pack 2026-10-30 · ~984 tokens -->

# Cosmos DB for MongoDB wildcard differences

> Source-anchored research for Cosmos DB for MongoDB wildcard differences. Run status: COMPLETED.

Parent: [MongoDB Wildcard and Hidden Indexes, Index Builds and Index Overhead](https://llms-explorer.com/tree/mongodb-wildcard-and-hidden-indexes-index-builds-and-index-overhead/) · 2 facets · 9 facts · page: https://llms-explorer.com/tree/cosmos-db-for-mongodb-wildcard-differences/

## Comparisons and alternatives

- TTL and unique properties are unsupported for wildcard indexes in both Cosmos DB for MongoDB and MongoDB Server. These restrictions are shared limitations rather than Cosmos-specific differences. (medium confidence) (verified as of 2026-04-27) — [source](https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/indexing)
- Sergey Kibish reported 198,320 ms versus 12,015 ms for Cosmos MongoDB API inserts with wildcard versus required indexes. The January 2023 experiment used 10,000 approximately 4.5 KB documents in one partition and batches of 1,000; treat these as historical workload-specific measurements, not a current service-wide ratio. (low confidence) — [source](https://sergeykibish.com/blog/cosmos-db-api-for-mongodb-vs-cosmos-db-api-for-nosql-vs-mongodb-atlas/)

## Facts and statements

- Cosmos DB for MongoDB documents wildcard support for multiple predicate fields and filtering performance equivalent to separate per-property indexes. MongoDB Server can use a wildcard term for only one predicate field; ordinary terms in a compound wildcard index can serve additional predicates. (medium confidence) (verified as of 2026-04-27) — [source](https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/troubleshoot-query-performance)
- Cosmos DB for MongoDB accepts {"$**":1} for all fields and {"children.$**":1} for a subtree. MongoDB also supports wildcard indexing for arbitrary fields; shared syntax does not establish identical planner behavior. (medium confidence) (verified as of 2026-04-27) — [source](https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/indexing)
- Cosmos DB for MongoDB does not support wildcardProjection inclusion/exclusion of multiple specific fields; Microsoft suggests multiple wildcard indexes. MongoDB supports field inclusion/exclusion through wildcardProjection. (medium confidence) (verified as of 2026-04-27) — [source](https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/indexing)
- Cosmos DB for MongoDB lists compound wildcard indexes as unsupported. MongoDB Server supports compound wildcard indexes, with one wildcard term and restrictions on the ordinary index terms. (medium confidence) (verified as of 2026-04-27) — [source](https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/indexing)
- Broad wildcard indexing can increase Cosmos write and update RU charges. Microsoft recommends individual paths for write-heavy workloads; an independent 2023 experiment likewise observed substantially slower inserts with an all-property wildcard than with only required indexes. (medium confidence) (verified as of 2026-04-27) — [source](https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/indexing)
- Cosmos troubleshooting recommends measuring query RU charge and explain metrics, including pathsIndexed, pathsNotIndexed, retrievedDocumentCount and outputDocumentCount. These metrics help verify whether a wildcard-index migration still serves the intended predicates. (low confidence) (verified as of 2026-04-27) — [source](https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/troubleshoot-query-performance)
- For Cosmos DB for MongoDB 3.6+, only _id and the shard key in sharded collections are automatically indexed. Version 3.2 indexed every property by default and requires an upgrade for wildcard creation; defaults must therefore be scoped by API version. (low confidence) (verified as of 2026-04-27) — [source](https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/indexing)
