-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Query Operations
-
None
The driver currently allows a value of 0 for maxStaleness, which it documents to mean "no maximum". This is unnecessarily confusing, as users might thing, despite the API docs, that maxStaleness of 0 means "totally fresh".
Consider changing the ReadPreference API to not treat 0 specially, and require either:
- use of overloaded factory methods that don't take a maxStaleness parameter to indicate that there is no maximum
- use boxed Long so that null can be passed as a value, and don't treat 0 specially.