Created
March 16, 2012 00:02
-
-
Save jperkelens/2047762 to your computer and use it in GitHub Desktop.
SAVE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var saveUser = function(callback) { | |
User.update({_id: this._id}, this, callback); | |
} | |
User.findOne = function(selector, callback) { | |
MongoHelper.findOne(selector, collectionName, function(err, result) { | |
if (err) return callback(err); | |
result.save = saveUser; | |
return callback(null, result); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment