Reputation: 6351
I have this query
mongorestore --db xxx --collection categories --filter '{"creation_date": {"$gt": ISODate("2015-06-06T20:00:00Z")}}' /backups/xxx/dump/xxx/xxx.bson
And have this error
assertion: 16619 code FailedToParse: FailedToParse: Bad characters in value: offset:25 of:{"creation_date": {"$gt": ISODate("2015-06-06T20:00:00Z")}}
I think mongorestore is not happy with ISODate, any ideas?
Upvotes: 1
Views: 258
Reputation: 31182
I had the same problem then I found this GitHub issue that points to this JIRA issue that states, that we can use {"$date": "2015-06-06T20:00:00Z"}
instead of ISODate("2015-06-06T20:00:00Z")
so your query should look like this:
mongorestore --db xxx --collection categories --filter '{"creation_date": {"$gt": {"$date": "2015-06-06T20:00:00Z"}}}' /backups/xxx/dump/xxx/xxx.bson
This feature is documented in MongoDB Extended JSON.
Upvotes: 1