File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
operations/search_indexes Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -391,9 +391,3 @@ export class ClientBulkWriteCursorResponse extends CursorResponse {
391
391
return this . get ( 'writeConcernError' , BSONType . object , false ) ;
392
392
}
393
393
}
394
-
395
- export class CreateSearchIndexesResponse extends MongoDBResponse {
396
- get indexesCreated ( ) {
397
- return this . get ( 'indexesCreated' , BSONType . array ) ;
398
- }
399
- }
Original file line number Diff line number Diff line change 1
- import { type Document } from '../../bson' ;
1
+ import { BSONType , type Document , parseUtf8ValidationOption } from '../../bson' ;
2
2
import { type Connection } from '../../cmap/connection' ;
3
- import { CreateSearchIndexesResponse } from '../../cmap/wire_protocol/responses' ;
3
+ import { MongoDBResponse } from '../../cmap/wire_protocol/responses' ;
4
4
import type { Collection } from '../../collection' ;
5
5
import type { ServerCommandOptions } from '../../sdam/server' ;
6
6
import type { ClientSession } from '../../sessions' ;
@@ -21,6 +21,12 @@ export interface SearchIndexDescription extends Document {
21
21
type ?: string ;
22
22
}
23
23
24
+ class CreateSearchIndexesResponse extends MongoDBResponse {
25
+ get indexesCreated ( ) {
26
+ return this . get ( 'indexesCreated' , BSONType . array ) ;
27
+ }
28
+ }
29
+
24
30
/** @internal */
25
31
export class CreateSearchIndexesOperation extends ModernizedOperation < string [ ] > {
26
32
override SERVER_COMMAND_RESPONSE_TYPE = CreateSearchIndexesResponse ;
@@ -47,7 +53,10 @@ export class CreateSearchIndexesOperation extends ModernizedOperation<string[]>
47
53
}
48
54
49
55
override handleOk ( response : InstanceType < typeof this . SERVER_COMMAND_RESPONSE_TYPE > ) : string [ ] {
50
- const indexesCreated = response . indexesCreated ?. toObject ( ) ;
56
+ const indexesCreated = response . indexesCreated ?. toObject ( {
57
+ ...this . bsonOptions ,
58
+ validation : parseUtf8ValidationOption ( this . bsonOptions )
59
+ } ) ;
51
60
return indexesCreated ? Object . entries ( indexesCreated ) . map ( ( [ _key , val ] ) => val . name ) : [ ] ;
52
61
}
53
62
You can’t perform that action at this time.
0 commit comments