Fixes issue where only id would be saved when updating an existing object for mongodb driver.
.save instead of .update was being called which would persist only a data object with the id value to the database on doing a save of an existing object.
This commit is contained in:
parent
752e711bca
commit
a565dbbd12
|
@ -63,7 +63,7 @@ MongoDB.prototype.create = function (model, data, callback) {
|
||||||
};
|
};
|
||||||
|
|
||||||
MongoDB.prototype.save = function (model, data, callback) {
|
MongoDB.prototype.save = function (model, data, callback) {
|
||||||
this.collection(model).save({_id: new ObjectID(data.id)}, data, function (err) {
|
this.collection(model).update({_id: new ObjectID(data.id)}, data, function (err) {
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue