File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export const ExplainVerbosity = Object.freeze({
99} as const ) ;
1010
1111/** @public */
12- export type ExplainVerbosity = typeof ExplainVerbosity [ keyof typeof ExplainVerbosity ] ;
12+ export type ExplainVerbosity = string ;
1313
1414/**
1515 * For backwards compatibility, true is interpreted as "allPlansExecution"
@@ -35,20 +35,18 @@ export class Explain {
3535 ? ExplainVerbosity . allPlansExecution
3636 : ExplainVerbosity . queryPlanner ;
3737 } else {
38- this . verbosity = ExplainVerbosity [ verbosity ] ;
38+ this . verbosity = verbosity ;
3939 }
4040 }
4141
4242 static fromOptions ( options ?: ExplainOptions ) : Explain | undefined {
4343 if ( options ?. explain === undefined ) return ;
4444
4545 const explain = options . explain ;
46- if ( typeof explain === 'boolean' || explain in ExplainVerbosity ) {
46+ if ( typeof explain === 'boolean' || typeof explain === 'string' ) {
4747 return new Explain ( explain ) ;
4848 }
4949
50- throw new MongoDriverError (
51- `explain must be one of ${ Object . keys ( ExplainVerbosity ) } or a boolean`
52- ) ;
50+ throw new MongoDriverError ( 'explain must be a string or a boolean' ) ;
5351 }
5452}
You can’t perform that action at this time.
0 commit comments