Last active
August 21, 2018 11:58
-
-
Save m-x-k/3639ab9aee254bad1593f0fb616200ce to your computer and use it in GitHub Desktop.
Pymongo load $date timestamp or isodate using bson.json_util.loads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bson import json_util | |
# load as timestamp | |
print json_util.loads('{"$date": 1414516147000}') | |
# load as isodate | |
print json_util.loads('{"$date": "2014-10-28T17:09:07.000Z"}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment