Skip to content
Browse files

update mongodb store to return the id after `put`

  • Loading branch information...
1 parent 40c8a51 commit 834bf905ebf5fa8c6f829f9b566a3af023b2485b @neonstalwart committed Oct 1, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 store/mongodb.js
View
4 store/mongodb.js
@@ -275,7 +275,7 @@ module.exports = function(options){
// .insert() returns array, we need the first element
obj = obj && obj[0];
if (obj) delete obj._id;
- deferred.resolve(obj);
+ deferred.resolve(obj.id);
});
} else {
deferred.reject(id + " exists, and can't be overwritten");
@@ -285,7 +285,7 @@ module.exports = function(options){
collection.update(search, object, {upsert: directives.overwrite}, function(err, obj){
if (err) return deferred.reject(err);
if (obj) delete obj._id;
- deferred.resolve(obj);
+ deferred.resolve(id);
});
}
return deferred;

0 comments on commit 834bf90

Please sign in to comment.
Something went wrong with that request. Please try again.