Mongoose - MongoError: Unrecognized pipeline stage name: '$eq'

When I run the following Mongoose aggregate query, I get an error:

Query:

await Users.aggregate([
    { $eq: ["$bot", false] }
]);

Error:

MongoError: Unrecognized pipeline stage name: '$eq'
    at queryCallback (/root/Geola/node_modules/mongodb-core/lib/cursor.js:248:25)
    at /root/Geola/node_modules/mongodb-core/lib/connection/pool.js:532:18
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)

Am I using it wrong?

MongoDB: 4.0.6

Mongoose: 5.4.13

Ubuntu: 16.04

#node-js #mongodb

3 Likes88.95 GEEK