mongo.py 文件源码

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

项目:stockreader 作者: julianespinel 项目源码 文件源码
def save_stock_historical_data(self, quote, stock_historical_data_array):
        if len(stock_historical_data_array) > 0:
            try:
                collection_name = quote + self.HISTORICAL_DATA_SUFIX
                self.create_historical_collection_if_not_exists(collection_name)
                stock_historical_data_collection = self.db[collection_name]
                stock_historical_data_collection.insert_many(stock_historical_data_array, ordered=False)
            except (DuplicateKeyError, BulkWriteError) as err:
                logger.error("save_stock_historical_data: %s %i %s", quote, len(stock_historical_data_array), err)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号