From 16e92be86070b6a7c13972cc2fd1578d566e144b Mon Sep 17 00:00:00 2001 From: zeMirco Date: Thu, 31 Jul 2014 21:16:09 +0200 Subject: [PATCH] use findOne instead find.nextObject (fix #3) --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0777568..d2168af 100644 --- a/index.js +++ b/index.js @@ -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); }; @@ -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); }); };