Open Vinze opened 9 years ago
I'm trying to fetch a single user (without password) from the database, but having some trouble understanding how to accomplisch this.
// Doesn't work User.omit('password').get(1, function(err, user) { res.json(user); }); // Doesn't work either User.get(1).omit('password').run(function(err, user) { res.json(user); }); // Does work, but looks overcomplicated User.find({ id: 1 }).omit('password').run(function(err, user) { res.json(user[0]); });
What's the right way to do this?
Last one is quite clean. Very verbose.
I'm trying to fetch a single user (without password) from the database, but having some trouble understanding how to accomplisch this.
What's the right way to do this?