Skip to content

Instantly share code, notes, and snippets.

@AlexandreProenca
Created April 6, 2016 23:01
Show Gist options
  • Save AlexandreProenca/83cf7f65b4e04f26ff41a5f908febcc6 to your computer and use it in GitHub Desktop.
Save AlexandreProenca/83cf7f65b4e04f26ff41a5f908febcc6 to your computer and use it in GitHub Desktop.
from pymongo import MongoClient
client = MongoClient()
db = client.sbhistory
cursor = db.room.find()
for document in cursor:
document['payload']['details']['users_name'] = [{"username": i, "seen": None, "received": None} for i in document['payload']['details']['users_name']]
db.room2.insert(document)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment