I\'m trying to write a date comparison query using MongoDB\'s strict JSON representation of BSON.
I\'d like it to work in the MongoDB shell (v2.4.3)<
The mongo shell doesn't support Strict JSON mode. See this ticket: https://jira.mongodb.org/browse/SERVER-6813.
This library here may do what you are looking for (although I haven't tried it): https://www.npmjs.com/package/mongodb-extended-json. I don't use the mongo shell for anything complex so I don't know if or how you could get this working in the shell.
As a side note, if you are willing to use a different language, I'm using the following code for pymongo.
import bson.json_util
mongo_queryD = bson.json_util.loads(mongo_query_str)
db.collection.find(mongo_queryD)
Unfortunately, this will only work for the last two examples with the timestamp in int64 format.