Object of type ‘ObjectId‘ is not JSON serializable 解决办法 from bson import json_util json_util.dumps(data)