-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Query Operations
-
None
DBCursor#addOption allows a user to set the option Bytes.QUERYOPTION_TAILABLE. There are no circumstances where a user would not want to also set Bytes.QUERYOPTION_AWAITDATA, so if the former is set, the latter will now also be set.
As part of this change, there will be a behavioral change to DBCursor#hasNext(). It used to be that if tailable was set but not awaitData, hasNext() could return false on one invocation, followed by true on the next. This really violates the contract of Iterator, so the driver will no longer allow it. DBCursor#hasNext will now block until either a new document is available or the cursor is no longer valid.