I have a collection “companies”. Every object in this collection has “lastcall”-param. It’s a simple string, containing UNIX time of the last call. I’d like to find all the companies, where lastcall is higher than a AND lower than b. How can I do this? Here’s the code I use to access to compnaies:
//query to lastcall
collection.find( {'lastcall': a} , function (err, companies) {
companies.each(function (err, company) {
//do something with every object...
});
});
This code will return all the companies where ‘lastcall’ = A, but I need all the ones where A < ‘lastcall’ < B. How can I do this? Thanks!
There is an example in the docs for Advanced Queries that’s exactly what you want: