Class: Mongo::Operation::Explain::Result

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

Overview

Defines custom behavior of results in find command with explain.

Since:

  • 2.5.0

Instance Method Summary collapse

Instance Method Details

#cursor_id0

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:

  • (0)

    Always 0 because explain doesn't return a cursor.

Since:

  • 2.5.0



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

def cursor_id
  0
end

#documentsArray<BSON::Document>

Get the documents in the result.

Examples:

Get the documents.

result.documents

Returns:

  • (Array<BSON::Document>)

    The documents.

Since:

  • 2.5.0



47
48
49
# File 'lib/mongo/operation/explain/result.rb', line 47

def documents
  reply.documents
end