[JAVA-2831] If batch size is 0 for listCollections or listIndexes, don't include it in the cursor document Created: 17/Apr/18  Updated: 28/Oct/23  Resolved: 18/Apr/18

Status: Closed
Project: Java Driver
Component/s: Command Operations
Affects Version/s: None
Fix Version/s: 3.8.0

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-34517 getMore in session while running with... Closed
is related to JAVA-2834 Re-enable tests after SERVER-34517 is... Closed

 Description   

Currently the batchSize property of ListCollectionsOperation and ListIndexesOperations is int and defaults to 0. Then when constructing the cursor document for listCollections or listIndexes, it includes the batchSize even if it's 0. This forces an extra round trip for these operations, as the result will contain no documents, and a getMore has to be done.

The batch size should be excluded if it's 0.

Fortuitously, it also exposed SERVER-34517.



 Comments   
Comment by Githook User [ 18/Apr/18 ]

Author:

{'email': 'jeff.yemin@10gen.com', 'username': 'jyemin', 'name': 'Jeff Yemin'}

Message: JAVA-2831: Don't send batch size of 0 for listCollections or listIndexes
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/80556b3a21325df1e3fcedb8045aca7281eaa3ea

Generated at Thu Feb 08 08:58:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.