def update_item(): db = client.lagou.intervieweeComment query_dict = {} for document in query_document(query_dict): sentiment_value = cal_sentiment(document['content']) db.update_many( {"orderId": document['orderId']}, {"$set": {"sentiment": sentiment_value}} ) print('insert sentiment value %f successfully~' % sentiment_value)
def update_item(): db = client.lagou.intervieweeComment query_dict = {} for document in query_document(query_dict): sentiment_value = cal_sentiment(document['content']) db.update_many({"orderId": document['orderId']}, {"$set": { "sentiment": sentiment_value }}) print('insert sentiment value %f successfully~' % sentiment_value)