Closed kjrhody closed 6 years ago
It appears that the following code was needed in for userId
in the schema, since in other cases that had been null
when it was the server rather than user running the update:
userId: {
type: String,
autoValue: function(){
if (this.userId === null){
return "server";
}
else{
return this.userId;
}
}
},
I have the following code in a migrations file to update a status of a particular item in a collection. However when the migration runs, I get the following error, despite having the value in the schema and having the field as optional:
Error:
Code: migrations.js:
schema: