python中如何判断mongodb查询结果为空?

2025-05-08 20:37:02
推荐回答(1个)
回答1:

ret = collection.find({})
if not ret or ret.count() == 0:
print "result is null"