-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Java Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Summary
When using the MongoDB Scala Driver 5.6.0 with MongoDB Server 8.0.12, queries that do not explicitly set a batchSize result in the driver sending a batchSize value of -2147483648 (i.e., Integer.MIN_VALUE). MongoDB 8.0.12 rejects this value with the following error:
Command execution failed on MongoDB server with error 2 (BadValue): 'BSON field 'batchSize' value must be >= 0, actual value '-2147483648'' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "BSON field 'batchSize' value must be >= 0, actual value '-2147483648'", "code": 2, "codeName": "BadValue"}
How to Reproduce
- Set up a MongoDB 8.0.12 server.
- Use the MongoDB Scala Driver 5.6.0 to perform a query (e.g., find, aggregate, listCollections) without explicitly setting a batchSize.
- Observe the error message indicating that the batchSize is invalid.
Expected Behavior
The driver should allow MongoDB to use its default behavior when the batchSize is not explicitly set since it arises compatibility issues.
Environment
- MongoDB Server: 8.0.12
- MongoDB Scala Driver: 5.6.0
- Scala Version: 2.12
- is related to
-
JAVA-5970 Incorrect limit set when using Int.MaxValue
-
- In Code Review
-