private BsonTimestamp GetInitialOperationTimeIfRequired(IChannelHandle channel, IReadBinding binding, ICursorBatchInfo cursorBatchInfo) { if (_startAtOperationTime == null && _resumeAfter == null && _startAfter == null) { var maxWireVersion = channel.ConnectionDescription.IsMasterResult.MaxWireVersion; if (maxWireVersion >= 7) { if (cursorBatchInfo.PostBatchResumeToken == null && cursorBatchInfo.WasFirstBatchEmpty) { return(binding.Session.OperationTime); } } } return(null); }
private BsonDocument GetInitialPostBatchResumeTokenIfRequired(ICursorBatchInfo cursorBatchInfo) { // If the initial aggregate returns an empty batch, but includes a `postBatchResumeToken`, then we should return that token. return(cursorBatchInfo.WasFirstBatchEmpty ? cursorBatchInfo.PostBatchResumeToken : null); }