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 {
391391 return this . get ( 'writeConcernError' , BSONType . object , false ) ;
392392 }
393393}
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' ;
22import { type Connection } from '../../cmap/connection' ;
3- import { CreateSearchIndexesResponse } from '../../cmap/wire_protocol/responses' ;
3+ import { MongoDBResponse } from '../../cmap/wire_protocol/responses' ;
44import type { Collection } from '../../collection' ;
55import type { ServerCommandOptions } from '../../sdam/server' ;
66import type { ClientSession } from '../../sessions' ;
@@ -21,6 +21,12 @@ export interface SearchIndexDescription extends Document {
2121 type ?: string ;
2222}
2323
24+ class CreateSearchIndexesResponse extends MongoDBResponse {
25+ get indexesCreated ( ) {
26+ return this . get ( 'indexesCreated' , BSONType . array ) ;
27+ }
28+ }
29+
2430/** @internal */
2531export class CreateSearchIndexesOperation extends ModernizedOperation < string [ ] > {
2632 override SERVER_COMMAND_RESPONSE_TYPE = CreateSearchIndexesResponse ;
@@ -47,7 +53,10 @@ export class CreateSearchIndexesOperation extends ModernizedOperation<string[]>
4753 }
4854
4955 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+ } ) ;
5160 return indexesCreated ? Object . entries ( indexesCreated ) . map ( ( [ _key , val ] ) => val . name ) : [ ] ;
5261 }
5362
You can’t perform that action at this time.
0 commit comments