Let’s say I configure a $schema validation rule for my collection.
If I set the Validation level to off (so update/insert will work no matter what)
How can I query a list of documents that pass/fail the schema validation?
Let’s say I configure a $schema validation rule for my collection.
If I set the Validation level to off (so update/insert will work no matter what)
How can I query a list of documents that pass/fail the schema validation?
Hi @Alex_Bjorlig,
You can use the $jsonSchema
operator to find existing documents that that match (or do not match) a JSON schema validator.
There are some examples in the Query Conditions section of the $jsonSchema
operator documentation.
Regards,
Stennie
Ahh thanks @Stennie_X !
Now that I have your attention, could I politely ask if you have Typescript <–> JSON Schema expertise - or maybe know someone at MongoDB?
Our team is still debating how to maintain Typescript interfaces and MongoDB JSON schemas. I tried to ask for inputs here, but to my surprise nobody answered
I imagine this is a task everyone using Typescript/Mongodb-schema-validation would have, but there is supringsly few results when I google this.
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.