When set, this configures an explain command. Valid values are boolean (for legacy compatibility,
see ExplainVerbosityLike), a string containing the explain verbosity, or an object containing the verbosity and
an optional maxTimeMS.
maxTimeMS can be configured to limit the amount of time the server
spends executing an explain by providing an object:
// limits the `explain` command to no more than 2 seconds collection.find({ name:'john doe' }, { explain: { verbosity:'queryPlanner', maxTimeMS:2000 } });
When set, this configures an explain command. Valid values are boolean (for legacy compatibility, see ExplainVerbosityLike), a string containing the explain verbosity, or an object containing the verbosity and an optional maxTimeMS.
Examples of valid usage:
maxTimeMS can be configured to limit the amount of time the server spends executing an explain by providing an object: