在mongodb
中上传/更新列时:
persona.update_many({u"_id":(result["_id"])},{"$set": {column_name:df1.iloc[:,m][(list(result.values())[1])-1]}})
我收到此错误:
unsupported operand type(s) for -: 'ObjectId' and 'int'
答案 0 :(得分:0)
来自bson import ObjectId
persona.update_many({"_id":ObjectId(result["_id"])},{"$set": {column_name:df1.iloc[:,m][(list(result.values())1)-1]}})
插入ObjectId它将解决问题