dsanel / mongoose-delete

Mongoose Soft Delete Plugin
MIT License
346 stars 101 forks source link

Chain queries #72

Closed Kuzzy closed 3 years ago

Kuzzy commented 4 years ago

Hello.

In mongoose we can chain query methods like this:

Customer.find({ email: /foo\.bar/ }).find({ age: { $gte: 30 } });

But with mongoose-delete methods does not work:

Customer.find({ email: /foo\.bar/ }).findWithDeleted({ age: { $gte: 30 } });

// Customer.find(...).findWithDeleted is not a function

Can we extend Query object somehow to make it work?

Thanks.