Module: Mongo::Collection::View::Explainable

Included in:
Mongo::Collection::View, Aggregation
Defined in:
lib/mongo/collection/view/explainable.rb

Overview

Defines explain related behaviour for collection view.

Since:

  • 2.0.0

Constant Summary

QUERY_PLANNER =

The query planner verbosity constant.

Since:

  • 2.2.0

'queryPlanner'.freeze
EXECUTION_STATS =

The execution stats verbosity constant.

Since:

  • 2.2.0

'executionStats'.freeze
ALL_PLANS_EXECUTION =

The all plans execution verbosity constant.

Since:

  • 2.2.0

'allPlansExecution'.freeze

Instance Method Summary collapse

Instance Method Details

#explainHash

Get the explain plan for the query.

Examples:

Get the explain plan for the query.

view.explain

Returns:

  • (Hash)

    A single document with the explain plan.

Since:

  • 2.0.0



47
48
49
# File 'lib/mongo/collection/view/explainable.rb', line 47

def explain
  self.class.new(collection, selector, options.merge(explain_options)).first
end