Skip to content

Commit

Permalink
use findOne instead find.nextObject (fix #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
zemirco committed Jul 31, 2014
1 parent 749de67 commit 16e92be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Adapter.prototype.save = function(name, email, pw, done) {
Adapter.prototype.find = function(match, query, done) {
var qry = {};
qry[match] = query;
this.db.collection(this.collection).find(qry).nextObject(done);
this.db.collection(this.collection).findOne(qry, done);
};


Expand Down Expand Up @@ -151,7 +151,7 @@ Adapter.prototype.update = function(user, done) {
that.db.collection(that.collection).save(user, function(err, res) {
if (err) return done(err);
// res is not the updated user object! -> find manually
that.db.collection(that.collection).find({_id: user._id}).nextObject(done);
that.db.collection(that.collection).findOne({_id: user._id}, done);
});
};

Expand Down

0 comments on commit 16e92be

Please sign in to comment.