Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pymongo import MongoClient
- client = MongoClient('<MongoDB URI here>')
- db = client.fpcdata # may be diff
- posts = db.posts # same
- # HOW TO INSERT
- data_to_insert = {'i': '1', 'data': 'xsd123'}
- posts.insert_one(data_to_insert)
- # HOW TO GET
- r = posts.find_one({'i': '1'})
- print(r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement