0

I would like to do a query based on a MongoDB ISODate field. However, I'm not sure how to serialize a Java Date object into the correct ISODate object, which can then be used with QueryBuilder. A little example code would be greatly appreciated. Thanks a lot.

1 Answer 1

1

Serialization of a Date object to the appropriate representation in JSON ({$date:

builder.greaterThan(new Date())

works just fine. Be wary of timezones though.

Sign up to request clarification or add additional context in comments.

1 Comment

I couldn't get expected result because of another bug. The date serialization part works well actually. In any case, thanks for your quick and insightful reply! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.