Insert timestamp to identify json - Python

76 views
Skip to first unread message

Lorena Santana

unread,
Dec 7, 2015, 12:45:07 AM12/7/15
to mongodb-user

I'm working with the google API flights where my code it does request every 1 hour (and is looping and stop when I say), and every json generated a .json file is created, and the json that fileIt is sent to the mongoDB. As JSON is one below the other, I need a way to differentiate it then wanted to put the timestamp on each request response.

Then I will create a graphic in matplotlib taking the mongodb information, so I need each JSON to differentiate from one another.





Bernie Hackett

unread,
Dec 7, 2015, 12:50:27 PM12/7/15
to mongodb-user
See the example documentation for using datetimes in PyMongo:

Reply all
Reply to author
Forward
0 new messages