Class: Mongo::Operation::GetMore::Result

Inherits:
Operation::Result
  • Object
show all
Defined in:
lib/mongo/operation/get_more/result.rb

Overview

Defines custom behavior of results for the get more command.

Since:

  • 2.2.0

Instance Method Summary collapse

Instance Method Details

#cursor_idInteger

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Get the cursor id.

Examples:

Get the cursor id.

result.cursor_id

Returns:

  • (Integer)

    The cursor id.

Since:

  • 2.2.0



34
35
36
# File 'lib/mongo/operation/get_more/result.rb', line 34

def cursor_id
  cursor_document ? cursor_document[CURSOR_ID] : super
end

#documentsArray<BSON::Document>

Get the documents in the result.

Examples:

Get the documents.

result.documents

Returns:

  • (Array<BSON::Document>)

    The documents.

Since:

  • 2.2.0



56
57
58
# File 'lib/mongo/operation/get_more/result.rb', line 56

def documents
  cursor_document[NEXT_BATCH]
end

#post_batch_resume_tokenBSON::Document | nil

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Get the post batch resume token for the result

Returns:

  • (BSON::Document | nil)

    The post batch resume token

Since:

  • 2.2.0



43
44
45
# File 'lib/mongo/operation/get_more/result.rb', line 43

def post_batch_resume_token
  cursor_document ? cursor_document['postBatchResumeToken'] : nil
end