Created
November 27, 2013 18:28
-
-
Save A/7680736 to your computer and use it in GitHub Desktop.
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
exports.get = function(req, res){ | |
User.find(null, 'email -_id', function(err, users) { | |
if (err) return res.json(500, err); | |
var retobj = {}; | |
var keys = Object.keys(users); | |
var i = keys.length; | |
while (i--) retobj[i] = users[keys[i]] && users[keys[i]].email; | |
res.json(retobj); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment