An Azure NoSQL database service for app development.
I think u can’t enable this preview on vCore at all. It’s a service side rollout only, so for now just keep ur app schema guarding writes and do a tiny scratch DB insert to catch drift early.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Looking to enable the Preview $jsonSchema collection validator feature introduced in the Oct 10 2025 service release notes (engine build 1017: "Add schema validation support for $jsonSchema during rule creation or modification") on our vCore cluster.
Cluster details. Resource: linramongodb-eu. Resource group: rg-fizzychat-prod. Subscription: b28ab9df-7c51-4dd2-b59d-1a3d43ae21d7 (Microsoft Azure Sponsorship). Region: Germany North. Tier: M20 burstable, 32 GB Premium SSD. Server version: 8.0 (confirmed via buildInfo). Resource type: Microsoft.DocumentDB/mongoClusters.
What we see today: every collection-validator path is rejected with errmsg "validator not supported yet". Tested all of: db.createCollection(name, { validator: { $jsonSchema: ... } }) rejected; db.command({ collMod, validator }) rejected; validationAction "warn" rejected; validator {} with validationLevel "off" rejected (even disabling requires the feature); listCollections returning validator options rejected.
Query-side $jsonSchema used inside $match works fine. It's specifically the collection-level write enforcement that's gated.
Could the Preview flag be enabled on this cluster? Happy to accept the Preview risks. Couldn't find a self-serve toggle: checked the stable and 2026-02-01-preview ARM API surface and az feature list --namespace Microsoft.DocumentDB (50+ flags, none for validators).
Use case: pair Mongo-engine validation with our existing app-side Zod validators so any write path (app, migration script, ad-hoc Mongo shell) is gated by the same schema. Without it, schema enforcement is app-only and anything that bypasses our wrapper gets through.
Thanks!
An Azure NoSQL database service for app development.
Answer accepted by question author
I think u can’t enable this preview on vCore at all. It’s a service side rollout only, so for now just keep ur app schema guarding writes and do a tiny scratch DB insert to catch drift early.
AI answer
The $jsonSchema collection validator feature in Azure DocumentDB (MongoDB compatibility) is in Preview and must be explicitly enabled as a preview feature on the subscription/cluster before collection-level validators can be used. Until the preview is registered, commands that configure collection validators will continue to fail with errors such as "validator not supported yet", even though $jsonSchema works inside queries.
The October 10, 2025 engine release (build 1017) explicitly marks schema validation support for $jsonSchema as [Preview] and notes that preview items require enablement:
$jsonSchema during rule creation or modification is a preview engine enhancement.To enable this preview feature for the specified Azure DocumentDB cluster:
Microsoft.DocumentDB in the subscription:
Microsoft.DocumentDB.$jsonSchema schema validation / collection validators (the exact name is defined in the preview-features list for Microsoft.DocumentDB).Pending for an abnormal amount of time, create an Azure support request and reference that the cluster is on engine build 1017+ and needs the $jsonSchema schema validation preview enabled. Azure support can confirm eligibility and complete enablement for the specific mongoClusters resource.db.createCollection(<name>, { validator: { $jsonSchema: { ... } } })db.runCommand({ collMod: <name>, validator: { $jsonSchema: { ... } } })Supported $jsonSchema keywords in Azure DocumentDB include bsonType, properties, required, minLength, maxLength, minimum, maximum, items, minItems, maxItems, uniqueItems, and others. Keywords such as additionalProperties, enum, allOf, anyOf, oneOf, and not are not supported and must be handled via application logic or alternative query operators like $in.
If the preview feature does not appear in the subscription’s Preview features list, or if registration plus propagation still leaves validators disabled, open an Azure support ticket for the subscription and request that the $jsonSchema schema validation preview be enabled for the specific Microsoft.DocumentDB/mongoClusters resource.
References: