pyMongo中查询出来的错误笔记
2018-11-15 本文已影响11人
g0
1. 查到的是游标

将后台中的find改未find_one即可

2. 出现unicode乱码

转换一下编码即可
python2
cursor = json.dumps(cursor, encoding="UTF-8", ensure_ascii=False)
python3
字符串.encode('utf-8').decode('unicode_escape')

将后台中的find改未find_one即可
转换一下编码即可
python2
cursor = json.dumps(cursor, encoding="UTF-8", ensure_ascii=False)
python3
字符串.encode('utf-8').decode('unicode_escape')