I am using Loopback 3 and mongoDB
I add new field with default value in json model
{
"name": "myModel",
"options": {
"mongodb": {
"collection": "MyModel"
}
},
"mixins": {
"ShareApi": {
"allow": ["findById"]
}
},
"properties": {
"name": {
"type": "string",
"description": "name"
},
"newField": {
"type": "boolean",
"default": false
}
}
}
However, this just work for new documents. How to old documents are updated with newfield