1

I 'm doing a google API flights with Python, and put the timestamp , and now I saw that as the JSON API that generates is too large, serious good use mongoDB to the database and store. But I'm a little lost as to place the timestamp at mongoDB and make these data is stored there. Could someone give me a quick explanation about this and the " stepping stones " ( Where shall I begin , etc.) ?

Thank you: D

Community
  • 1
  • 1
Lorena Santana
  • 21
  • 1
  • 1
  • 3

1 Answers1

3

Some quick googling reveals you can just use python's datetime module. Take a look at this post.

Also here's an example from the PyMongo tutorial:

import datetime
post = {"author": "Mike",
        "text": "My first blog post!",
        "tags": ["mongodb", "python", "pymongo"],
        "date": datetime.datetime.utcnow()}

posts = db.posts
posts.insert(post)
Community
  • 1
  • 1
Alex Sherman
  • 494
  • 3
  • 9