0

In my mongo db database i have column like this.

"created_on" : ISODate("2014-07-02T01:38:48.713Z");

In order to to search this column am giving the following query:

db.XYZ.find({ "created_on" : ISODate("2014-07-02T01:38:48.713Z")})

Now i want to use java for retrieving this data from database: My query is like:

 DateTime dateTime = new DateTime( "2014-07-02T01:38:48.713Z" );
 BasicDBObject query1 = new BasicDBObject("created_on", dateTime);
 DBCursor cursor = table.find(query);

but am not getting anything query is returning 0 rows??

Any body please help how to set iso date from java.

0

1 Answer 1

1

The mongodb driver does not work with DateTime currently. You have to use java.util.Date

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

Comments

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.