hi - I wanted to view the JSON schema associated with a collection. I poked around the documentation and tried ``sqlGetSchema` command, but I get an error “Command not found”. I did set up roles and assigned the role to my user profile in Atlas. Interestingly enough, I could not find this command in Mongo 7.0 documentation . Is this command deprecated? How do I view a JSON schema?
Easy hack in mongosh …
use mydb
db.myCollection.find().pretty()
Of course best would be if when you create a collection you also create validation, then you have a permanent record.
Thank you for the response. But the query you posted returns the JSON documents. What I want to see is the Json Schema validator I attached with this DB. Regardless of when I attach a json schema validator with the collection (at the time of creation or afterwards), I am not able to view the schema validator on Atlas.
You can see the validator in Compass.
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.