Mongoose With Queries
Build your own domain specific language around your models using chainable mongoose queries.
Usage
npm install mongoose-with-queries
var withQueries = ; // Define your modelvar Product = mongoose; // Define your queries; // Use your queries // Bakery products available for sale// Product.find().where('category').equals('bakery').where('quantity').gt(0).exec()Productquery // Bargain produce we've already sold out of.// Product.find().where('category').equals('fruit').where('quantity').equals(0).where('price').lt(200).exec()Productquery
Contributing
Please follow our Code of Conduct when contributing to this project.
We currently test against a local mongodb so make sure you have mongod running.
$ git clone https://github.com/goodeggs/mongoose-with-queries && cd mongoose-with-queries
$ npm install
$ npm test
Module scaffold generated by generator-goodeggs-npm.