In Stitch -> rules, I open up MyCollection
, clicked on the Schema tab, and typed the following:
{
"bsonType": "object",
"required": [
"roadmapTitle"
],
"properties": {
"roadmapTitle": {
"bsonType": "string"
},
"creatorId": {
"bsonType": "objectId"
}
}
}
Saved & Deployed. However, if I insert a document like MyCollection.insertOne({nothing here: "hehe"})
, the Log shows okay, the object is stored, no error is caught. Interestingly though, running the validate function next to "edit schema" in the Schema field shows that all of those documents failed schema validation. Did I miss a step in enforcing the Schema validation on document insertion?