Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #35 from neonstalwart/mongo-ids

update mongodb store to return the id after `put`
  • Loading branch information...
commit 16aa238619b105e63a6c2ba7dd295cf83cfda444 2 parents 40c8a51 + 834bf90
@kriszyp kriszyp authored
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;
Please sign in to comment.
Something went wrong with that request. Please try again.