DB_API.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:StockRecommendSystem 作者: doncat99 项目源码 文件源码
def writeToCollection(collection, df, id = None):
    jsonStrings = df.to_json(orient='records')
    bsonStrings = json_util.loads(jsonStrings)
    for string in bsonStrings:
        if id is not None:
            id_string = ''.join([string[item] for item in id])
            string['_id'] = id_string
        collection.save(string)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号