|
samantha.ritter, jeff.yemin: IIRC, this issue relates somewhat to PHPLIB-451. I think the scenario common to both
C and PHPLIB is that we want to advance to the first result within the batch (if any) after either the initial aggregate or a resuming aggregate, without ever sending a superfluous getMore command. To address that, I tracked whether aggregate returned an empty firstBatch or not to decide if it was safe to call mongoc_cursor_next() without the risk of triggering a getMore.
What portion of the spec mandates an "extra" getMore and prohibits the above?
|
|
The spec tests for change streams mandate that we send this "extra" getMore after the aggregation. For some drivers' cursor implementations, where calling next() on the cursor may loop and wait for documents to become available, this makes more sense. For the C driver, the "extra" getMore right after a successful aggregation that returns an empty batch feels a bit superfluous, but it is spec-defined behavior. Closing this ticket "Works as Designed."
|