我想使用tweepy将Twitter数据存储在MongoDb中。我想以下面的格式存储它:
{
"followee": 12345,
"follower": 54321,
"follower_Name": abcd
}
怎么做?
答案 0 :(得分:0)
由于您使用的是Python,我建议: http://api.mongodb.org/python/current/tutorial.html
// Mongo shell
db.createCollection("tweeps")
db.tweeps.insert([{
"followee": 12345,
"follower": 54321,
"follower_Name": abcd
}])
// Python
tweeps = db.tweeps
tweeps.insert_many([{
"followed": 12345,
"follower": 54321,
"follower_Name": abcd
}])