Friday, 11 May 2018

Updating the path '__v' would create a conflict at '__v'



Two solutions:


Solution 1, disable __v of your model:

var schema = new mongoose.Schema({
   ...
}, {
  versionKey: false
});



Solution 2,   i found this issue after i updated my database to 3.6 . it was ok on 3.4. so you need to make sure 3.6 running on a "Compatible mode" you can do this by run below command:

db.adminCommand({setFeatureCompatibilityVersion: "3.4"})


However, if you are using atlas, you cannot do this.




No comments:

Post a comment