lib/mongo/cursor.rb
def close
      return if closed?

      unregister
      read_with_one_retry do
        spec = {
          coll_name: collection_name,
          db_name: database.name,
          cursor_ids: [id],
        }
        op = Operation::KillCursors.new(spec)
        execute_operation(op)
      end

      nil
    ensure
      end_session
      @cursor_id = 0
    end
# Closes this cursor, freeing any associated resources on the client and
# the server.
#
# @return [ nil ] Always nil.
#
# @raise [ Error::OperationFailure ] If the server cursor close fails.
# @raise [ Error::SocketError | Error::SocketTimeoutError ] When there is a network error.
Closes this cursor, freeing any associated resources on the client and
the server.
Closes this cursor freeing any associated resources on the client and the server .
def close
      return if closed?
      unregister
      read_with_one_retry do
        spec = {
          coll_name: collection_name,
          db_name: database.name,
          cursor_ids: [id],
        }
        op = Operation::KillCursors.new(spec)
        execute_operation(op)
      end
      nil
    ensure
      end_session
      @cursor_id = 0
    end
def close return if closed? unregister read_with_one_retry do spec = { coll_name : collection_name , db_name : database . name , cursor_ids : [ id ] , } op = Operation :: KillCursors . new ( spec ) execute_operation ( op ) end nil ensure end_session @cursor_id = 0 end
Closes this cursor, freeing any associated resources on the client and
the server.
Closes this cursor freeing any associated resources on the client and the server .
None
 nil 
[ Error::OperationFailure ] If the server cursor close fails.
[ Error :: OperationFailure ] If the server cursor close fails .
[ Error::SocketError | Error::SocketTimeoutError ] When there is a network error.
[ Error :: SocketError | Error :: SocketTimeoutError ] When there is a network error .