Difference between cursor.count() and cursor.size() in MongoDB
问题 What is the difference between the cursor.count() and cursor.size() methods of MongoDB's DBCursor ? 回答1: From the Javadoc of the MongoDB Java Driver, it says : DBCursor.count(): Counts the number of objects matching the query. This does not take limit/skip into consideration. DBCursor.size(): Counts the number of objects matching the query. This does take limit/skip into consideration. 回答2: More than an answer I'd like to point out an issue that our team faced "mixing" this two. We had