[DOCS-11459] Add examples for jsonSchema queries in online documentation Created: 15/Mar/18  Updated: 30/Oct/23  Resolved: 11/Jul/19

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: 3.6
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Minor - P4
Reporter: Guillaume Meister (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: document, example, jsonschema, query
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

https://docs.mongodb.com/manual/reference/operator/query/jsonSchema/#op._S_jsonSchema


Participants:
Days since reply: 4 years, 30 weeks, 6 days ago
Epic Link: DOCSP-1769
Story Points: 0.5

 Description   

Hi Team

I had a very hard finding how to query documents that satisfy (or not) a jsonSchema.

Asya gave me the code :
`db.collection.find({$jsonSchema:{<schema-here>}})` to find matching and `db.collection.find({$nor:[{$jsonSchema:{<schema-here>}}]})` to find non-matching.

Yet in the $jsonSchema page of our documentation, it lacks code examples in my opinion :
https://docs.mongodb.com/manual/reference/operator/query/jsonSchema/#op._S_jsonSchema

I would suggest to add the above queries examples



 Comments   
Comment by Githook User [ 11/Jul/19 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-11459: examples – tweak
Branch: v3.6
https://github.com/mongodb/docs/commit/b407fe070e6c7131699d974fcf517cc928544ac7

Comment by Githook User [ 11/Jul/19 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-11459: examples – tweak
Branch: v4.0
https://github.com/mongodb/docs/commit/c2056402e9af4eb829585d0793e96da82a6cf507

Comment by Githook User [ 11/Jul/19 ]

Author:

{'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}

Message: DOCS-11459: examples – tweak
Branch: master
https://github.com/mongodb/docs/commit/243fdee2cae2b13796ceadc6f57257919209d474

Comment by Githook User [ 11/Jul/19 ]

Author:

{'name': 'Kay Kim', 'username': 'kay-kim', 'email': 'kay.kim@10gen.com'}

Message: DOCS-11459: $jsonSchema examples
Branch: master
https://github.com/mongodb/docs/commit/3e68550ba4acc5def7424f650a2cac727ddaa9cd

Comment by Githook User [ 11/Jul/19 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-11459: $jsonSchema examples
Branch: v3.6
https://github.com/mongodb/docs/commit/a1069375a1f1f121c5b17f3241b6ce8e0647edb7

Comment by Githook User [ 11/Jul/19 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-11459: $jsonSchema examples
Branch: v4.0
https://github.com/mongodb/docs/commit/8fc46fc9ad9420a13ea7f3bd45636c086446ed66

Comment by Kay Kim (Inactive) [ 10/Jul/19 ]

Will also use this ticket to fix existing examples with improper dot-notation.

Generated at Thu Feb 08 08:02:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.