Turistforeningen / node-mongo-querystring

Query builder for accepting URL query parameters into your MongoDB queries. Safe and feature rich. Supports most of MongoDB's query operators such as $eq, $gt, $lt, $ne, $in, $nin, $exists, $regex, geospatial queries such as bbox and near, as well as your own custom query business logic!
MIT License
100 stars 31 forks source link

Added option for converting date to string. #76

Open michaek opened 6 years ago

michaek commented 6 years ago

Following from #67, this creates an option (date.toString) to use JavaScript date objects in queries rather than ISO strings. I didn't add test coverage for the option against all date formats, as it seemed that demonstrating the option works for each date method is sufficient.

Changing the arrow functions to standard functions does make things a bit uglier, but it's necessary to access the options on the bound this.

michaek commented 4 years ago

@Starefossen Is there a chance you might be able to review this PR and let me know if there's anything I should do to make it ready to merge?