aravindnc / mongoose-paginate-v2

A custom pagination library for Mongoose with customizable labels.

Home Page:https://www.npmjs.com/package/mongoose-paginate-v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Filter with not equal operator

kaboume opened this issue · comments

commented

Hi,
I want to filter documents not equal to the role "admin" :
So I wrote this line :
filter = {role: "$ne: 'admin'"};
but no documents are returned?

I think you are missing some syntax. Try:

filter = {role: { "$ne": 'admin' } };

Please reopen if the issue exists.