Module: Mongo::Collection::View::Explainable
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/mongo/collection/view/explainable.rb |
Overview
Defines explain related behavior for collection view.
Constant Summary
-
ALL_PLANS_EXECUTION =
The all plans execution verbosity constant.
'allPlansExecution'.freeze
-
EXECUTION_STATS =
The execution stats verbosity constant.
'executionStats'.freeze
-
QUERY_PLANNER =
The query planner verbosity constant.
'queryPlanner'.freeze
Instance Attribute Summary
- #explained? ⇒ Boolean readonly private
Instance Method Summary
-
#explain(**opts) ⇒ Hash
Get the query plan for the query.
- #explain_options(**opts) private
Instance Attribute Details
#explained? ⇒ Boolean
(readonly, private)
# File 'lib/mongo/collection/view/explainable.rb', line 65
def explained? !! [:explain] end
Instance Method Details
#explain(**opts) ⇒ Hash
Get the query plan for the query.
# File 'lib/mongo/collection/view/explainable.rb', line 59
def explain(**opts) self.class.new(collection, selector, .merge( (**opts))).first end