<queryString language="MongoDbQuery"> <![CDATA[{ collectionName: 'orders', findQuery : { customer: 12834, _id: { '$gte': ObjectId(Math.floor((new Date() - (1000*60*60*24*1) / 1000).toString(16) + "0000000000000000") } }, sort: { attr.order_No: -1 } }]]> </queryString>
Whats the correct usage for that? Why is the documentation so whack?
Can anybody provide information on the Date object usage or how to get Documents within the past N days ?
2 Answers:
Hi,
Here is a link to a page detailing how to perform a date range search on documents: http://cookbook.mongodb.org/patterns/date_range/
Please note, that while Jaspersoft is allowing and enabling a connection to MongoDB, the query language documentation and support are provided by MongoDB.
Thanks,
Assaf
The documentation for the MongoDB query language is here: http://community.jaspersoft.com/wiki/jaspersoft-mongodb-query-language remember that you need to use Strict JSON since that is what the Mongo Java driver is expecting.
There is also a wiki article that talks about using Date Parameters in MongoDB Queries