We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1e0a56b + 69a34e7 commit 8ba5f08Copy full SHA for 8ba5f08
1 file changed
src/index.js
@@ -131,8 +131,13 @@ class Service {
131
132
let { query, options } = multiOptions(id, params, this.id);
133
134
- // We can not update the id
135
- delete data[this.id];
+ if (this.id === '_id') {
+ // We can not update the id
136
+ delete data[this.id];
137
+ } else {
138
+ // If not using the default Mongo _id field, the id must be set to its previous value
139
+ data[this.id] = id;
140
+ }
141
142
return this.Model
143
.update(query, data, options)
0 commit comments