MongoDB中cursor.count()和cursor.size()之间的区别 [英] Difference between cursor.count() and cursor.size() in MongoDB
本文介绍了MongoDB中cursor.count()和cursor.size()之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
MongoDB的 cursor.count()
和 cursor.size()
方法有什么区别 DBCursor
?
What is the difference between the cursor.count()
and cursor.size()
methods of MongoDB's DBCursor
?
推荐答案
来自 MongoDB Java驱动程序的Javadoc ,它说:
DBCursor.count():计数与查询匹配的对象数。这个
确实不考虑限制/跳过。
DBCursor.count(): Counts the number of objects matching the query. This does not take limit/skip into consideration.
DBCursor.size():计算与查询匹配的对象数。这个
确实考虑了限制/跳过。
DBCursor.size(): Counts the number of objects matching the query. This does take limit/skip into consideration.
这篇关于MongoDB中cursor.count()和cursor.size()之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文