-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Fully Compatible
The shell helpers for explain (see SERVER-14875 and commit d601b91b6b16be3f9) introduced a new JavaScript class in the shell called DBExplainQuery. This class is similar to a DBQuery, and supports many of the same methods, but performs an explain of a .find() or a .count() rather than performing the operation itself.
Rather than having two separate abstractions, we could unify DBExplainQuery and DBQuery into a single query abstraction. Both types of queries must do their job by calling into the same Collection interface. A DBQuery would call into a normal collection and a DBExplainQuery would call into an Explainable collection.