The MongoDB cursor object provides a BatchSize property and and Limit property but I can’t seem to find any definitive information that properly clarifies the difference between the two.
I’m using the .Net driver, for what it’s worth.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Limit is the total number of results you want. If your query would return one thousand documents but you only want 5 you can use Limit to limit the size of the total result.
BatchSize is the number of results that should be returned in each batch. If your result set for a query is large MongoDB isn’t going to return all the results in one batch. It will return a subset of the total result, then the cursor will send a getMore message to the server when it needs the next batch of results.