I am trying the new MongoDb stitch but cannot work out with defining rules on fields.
When I try to insert a document it collection with no rules on any Fields or only in Top level document it inserts fine. But as soon as I add a Field an write a rule it gives error "document cannot be written to". Even when the rule is "{}" which always evaluates to true. Below is a sample insert Pipeline and defined rule.
TOP LEVEL DOCUMENT: R {} W "blank" FIELDS : name W {}
Insert Pipeline Stage 1 :
Service: "built-in", Action "literal",
args:"{
"items": [
{
"name": "Don Giovanni",
"cuisine": "Italian",
"location": "Chicago, IL",
"comments": [
{
"user_id": "leporello",
"comment": "Molto bene"
},
{
"user_id": "59b256814fdd1f75d5e1dce3",
"comment": "insertion"
},
{
"user_id": "59b256814fdd1f75d5e1dce3",
"comment": "good food"
},
{
"user_id": "59b256814fdd1f75d5e1dce3",
"comment": "very good food"
},
{
"user_id": "59b256814fdd1f75d5e1dce3",
"comment": "insertion"
}
]
}
]
}"
Stage 2 :
Service :"mongodb-atlas", Action:"insert",database:"guidebook", collection:"restaurants"