使用pymongo导出数据,但是查询到的数据量大小和循环写文件的大小差别很大,从来没有遇到过这个问题,网上也找不到相关的,求大神解答!
doc = {"$and": [
{"del": "0"},
{"$or": [
{"updatetime": {"$gt": update_time}},
{"score": {"$nin": ["A", "B", "C", "D", "E", "F"]}}
]}
]}
ret = mongo_table.find(doc, {"@id": 1})
# ret.count() 有18w+大小
if not ret or ret.count() < 1:
return
off = 0
for item in ret:
off += 1
# off只有7388,为什么呢?
print off