Jump to content
Changes to the Jaspersoft community edition download ×

new Date() In MongoDB Query


d.wendler

Recommended Posts

        <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>[/code]

 

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 ?

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...