mercredi 7 janvier 2015

Mongoose query to exclude a value from the result


Vote count:

0




I want to retrieve a users list but excluding the current user ID.


Right now I have it without the exclusion:



User.find()
.or([
{email: new RegExp(req.param('searchTerm'), 'i')},
{displayName: new RegExp(req.param('searchTerm'), 'i')}
],
'displayName email profileImageURL')
.limit(20)
.exec(function(err, users)


How can I change the query to use the AND I need to exclude the current userID?


Thanks



asked 1 min ago







Mongoose query to exclude a value from the result

Aucun commentaire:

Enregistrer un commentaire