Reputation: 3441
All I'm trying to do is to parse very simple json line, even its valid i dont know why its throwing an error
the line is
com.mongodb.util.JSONParseException:
{publish_status:'active',activation_date:{$lt:new Date()},expiration_date:{$gt:new Date()}}
^
what is wrong with the new Date()
as a value?
Upvotes: 0
Views: 887
Reputation: 26
I tried using the new date() in mongo DB 2.2.3 directly and it worked .. it created a value of ISODate.
You may try using this:
{publish_status:'active',activation_date:new Date(),expiration_date:new Date()}
Upvotes: 1
Reputation: 128809
That's not valid JSON at all. JSON syntax is defined on json.org, and it's always a string key with a value that's one of a string, number, boolean, null, array, or object. You're writing a Mongo query from Java. You should reformulate your question and retag appropriately.
Upvotes: 3