I'm trying to get the users from the mongo database using mongoose.
If i select a user i want to eliminate that user records and get all the remaining users from database.
how can i do that?
-
which parameter will decide about not selecting the user ?Muhammad Usman– Muhammad Usman2018-04-04 06:44:44 +00:00Commented Apr 4, 2018 at 6:44
-
whatever in record like nameNaga Lokesh Kannumoori– Naga Lokesh Kannumoori2018-04-04 07:27:33 +00:00Commented Apr 4, 2018 at 7:27
Add a comment
|
4 Answers
you can try to use the query below:-
UsersModel.find({ email: { $ne: '[email protected]' } })
Let me know if it helps. Thanks
Comments
UsersModel.find({ email: { $ne: '[email protected]' } })
for more follow this url
https://docs.mongodb.com/manual/reference/operator/query/ne/