lib/mongo/collection/view/change_stream.rb
# Iterate through documents returned by the change stream.
#
# This method retries once per error on resumable errors
# (two consecutive errors result in the second error being raised,
# an error which is recovered from resets the error count to zero).
#
# @example Iterate through the stream of documents.
#   stream.each do |document|
#     p document
#   end
#
# @return [ Enumerator ] The enumerator.
#
# @since 2.5.0
#
# @yieldparam [ BSON::Document ] Each change stream document.
Iterate through documents returned by the change stream.
This method retries once per error on resumable errors
(two consecutive errors result in the second error being raised,
an error which is recovered from resets the error count to zero).
Iterate through documents returned by the change stream . This method retries once per error on resumable errors ( two consecutive errors result in the second error being raised an error which is recovered from resets the error count to zero ) .
def each
          raise StopIteration.new if closed?
          loop do
            document = try_next
            yield document if document
          end
        rescue StopIteration => e
          return self
        end
def each raise StopIteration . new if closed? loop do document = try_next yield document if document end rescue StopIteration => e return self end
Iterate through documents returned by the change stream.
Iterate through documents returned by the change stream .
None
 Enumerator 
Each change stream document.
Each change stream document .
example
Iterate through the stream of documents. stream.each do |document| p document end
Iterate through the stream of documents . stream . each do |document| p document end
since
None