File "I:\ZhongTongFu-DaShuJu\Project\senseware1\senseware\mongo\utility\utility.py", line 60, in convert_to_json
new_json_obj = JSONEncoder(ignore_nan=True).encode(bson_obj)
File "E:\python2.7\lib\site-packages\simplejson\encoder.py", line 291, in encode
chunks = self.iterencode(o, _one_shot=True)
File "E:\python2.7\lib\site-packages\simplejson\encoder.py", line 373, in iterencode
return _iterencode(o, 0)
File "I:\ZhongTongFu-DaShuJu\Project\senseware1\senseware\mongo\utility\utility.py", line 45, in default
return json.JSONEncoder.default(self, o)
File "E:\python2.7\lib\site-packages\simplejson\encoder.py", line 268, in default
o.__class__.__name__)
TypeError: Object of type UpdateResult is not JSON serializable
错误提示是这样子的
意思是我的不符合json格式
代码是这样的
我发现我忘记写acknowledged这个了
我们把这个加上就ok了
返回的结果是TRUE代表添加成功