Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

update mongodb store to return the id after `put`

  • Loading branch information...
commit 834bf905ebf5fa8c6f829f9b566a3af023b2485b 1 parent 40c8a51
Ben Hockey authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 store/mongodb.js
4 store/mongodb.js
@@ -275,7 +275,7 @@ module.exports = function(options){
275 275 // .insert() returns array, we need the first element
276 276 obj = obj && obj[0];
277 277 if (obj) delete obj._id;
278   - deferred.resolve(obj);
  278 + deferred.resolve(obj.id);
279 279 });
280 280 } else {
281 281 deferred.reject(id + " exists, and can't be overwritten");
@@ -285,7 +285,7 @@ module.exports = function(options){
285 285 collection.update(search, object, {upsert: directives.overwrite}, function(err, obj){
286 286 if (err) return deferred.reject(err);
287 287 if (obj) delete obj._id;
288   - deferred.resolve(obj);
  288 + deferred.resolve(id);
289 289 });
290 290 }
291 291 return deferred;

0 comments on commit 834bf90

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