class Mongo::Operation::GetMore::Result
Defines custom behavior of results for the get more command.
@since 2.2.0 @api semiprivate
Public Instance Methods
Source
# File lib/mongo/operation/get_more/result.rb, line 34 def cursor_id cursor_document ? cursor_document[CURSOR_ID] : super end
Get the cursor id.
@example Get the cursor id.
result.cursor_id
@return [ Integer ] The cursor id.
@since 2.2.0 @api private
Calls superclass method
Mongo::Operation::Result#cursor_id
Source
# File lib/mongo/operation/get_more/result.rb, line 56 def documents cursor_document[NEXT_BATCH] end
Get the documents in the result.
@example Get the documents.
result.documents
@return [ Array<BSON::Document> ] The documents.
@since 2.2.0 @api public
Source
# File lib/mongo/operation/get_more/result.rb, line 43 def post_batch_resume_token cursor_document ? cursor_document['postBatchResumeToken'] : nil end
Get the post batch resume token for the result
@return [ BSON::Document | nil ] The post batch resume token
@api private
Private Instance Methods
Source
# File lib/mongo/operation/get_more/result.rb, line 62 def cursor_document @cursor_document ||= reply.documents[0][CURSOR] end
Source
# File lib/mongo/operation/get_more/result.rb, line 66 def first_document @first_document ||= reply.documents[0] end