File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export type IndexSpecification = OneOrMore<
7070> ;
7171
7272/** @public */
73- export interface IndexDescription {
73+ export interface IndexDescription extends CreateIndexesOptions {
7474 collation ?: CollationOptions ;
7575 name ?: string ;
7676 key : Document ;
Original file line number Diff line number Diff line change 1- import { expectType , expectDeprecated } from 'tsd' ;
1+ import { expectType , expectDeprecated , expectError } from 'tsd' ;
22
33import { MongoClient } from '../../src/mongo_client' ;
44import { Collection } from '../../src/collection' ;
@@ -32,3 +32,8 @@ const composedMap = mappedAgg.map<string>(x => x.toString());
3232expectType < AggregationCursor < string > > ( composedMap ) ;
3333expectType < string | null > ( await composedMap . next ( ) ) ;
3434expectType < string [ ] > ( await composedMap . toArray ( ) ) ;
35+
36+ // test that VALID_INDEX_OPTIONS like expireAfterSeconds are allowed in IndexDefinitions
37+ coll . createIndexes ( [ { key : { event : 1 } , name : 'event' , expireAfterSeconds : 2400 } ] ) ;
38+ // test that invalid options are not allowed
39+ expectError ( coll . createIndexes ( [ { key : { event : 1 } , name : 'event' , invalidOption : 2400 } ] ) ) ;
You can’t perform that action at this time.
0 commit comments