File tree 5 files changed +11
-14
lines changed
operations/search_indexes
5 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -1042,8 +1042,8 @@ export class Collection<TSchema extends Document = Document> {
1042
1042
* @remarks Only available when used against a 7.0+ Atlas cluster.
1043
1043
*/
1044
1044
async createSearchIndex ( description : SearchIndexDescription ) : Promise < string > {
1045
- const indexes = await this . createSearchIndexes ( [ description ] ) ;
1046
- return indexes [ 0 ] ;
1045
+ const [ index ] = await this . createSearchIndexes ( [ description ] ) ;
1046
+ return index ;
1047
1047
}
1048
1048
1049
1049
/**
@@ -1057,9 +1057,7 @@ export class Collection<TSchema extends Document = Document> {
1057
1057
* @remarks Only available when used against a 7.0+ Atlas cluster.
1058
1058
* @returns
1059
1059
*/
1060
- async createSearchIndexes (
1061
- descriptions : ReadonlyArray < SearchIndexDescription >
1062
- ) : Promise < string [ ] > {
1060
+ async createSearchIndexes ( descriptions : SearchIndexDescription [ ] ) : Promise < string [ ] > {
1063
1061
return executeOperation ( this . client , new CreateSearchIndexesOperation ( this , descriptions ) ) ;
1064
1062
}
1065
1063
Original file line number Diff line number Diff line change @@ -18,13 +18,13 @@ export interface SearchIndexDescription {
18
18
/** @internal */
19
19
export class CreateSearchIndexesOperation extends AbstractOperation < string [ ] > {
20
20
constructor (
21
- private readonly collection : Collection < any > ,
21
+ private readonly collection : Collection ,
22
22
private readonly descriptions : ReadonlyArray < SearchIndexDescription >
23
23
) {
24
24
super ( ) ;
25
25
}
26
26
27
- execute ( server : Server , session : ClientSession | undefined , callback : Callback < any > ) : void {
27
+ execute ( server : Server , session : ClientSession | undefined , callback : Callback < string [ ] > ) : void {
28
28
const namespace = this . collection . fullNamespace ;
29
29
const command = {
30
30
createSearchIndexes : namespace . collection ,
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ import type { ClientSession } from '../../sessions';
6
6
import type { Callback } from '../../utils' ;
7
7
import { AbstractOperation } from '../operation' ;
8
8
9
+ /** @internal */
9
10
export class DropSearchIndexOperation extends AbstractOperation < void > {
10
- /** @internal */
11
- constructor ( private readonly collection : Collection < any > , private readonly name : string ) {
11
+ constructor ( private readonly collection : Collection , private readonly name : string ) {
12
12
super ( ) ;
13
13
}
14
14
Original file line number Diff line number Diff line change 1
- import type { Document } from 'bson' ;
2
-
3
1
import type { Collection } from '../../collection' ;
4
2
import { AggregationCursor } from '../../cursor/aggregation_cursor' ;
5
3
import type { AggregateOptions } from '../aggregate' ;
@@ -10,8 +8,8 @@ export type ListSearchIndexesOptions = AggregateOptions;
10
8
/** @public */
11
9
export class ListSearchIndexesCursor extends AggregationCursor < { name : string } > {
12
10
/** @internal */
13
- static create < T extends Document > (
14
- { fullNamespace : ns , client } : Collection < T > ,
11
+ static create (
12
+ { fullNamespace : ns , client } : Collection ,
15
13
name : string | null ,
16
14
options : ListSearchIndexesOptions = { }
17
15
) : ListSearchIndexesCursor {
Original file line number Diff line number Diff line change @@ -6,9 +6,10 @@ import type { ClientSession } from '../../sessions';
6
6
import type { Callback } from '../../utils' ;
7
7
import { AbstractOperation } from '../operation' ;
8
8
9
+ /** @internal */
9
10
export class UpdateSearchIndexOperation extends AbstractOperation < void > {
10
11
constructor (
11
- private readonly collection : Collection < any > ,
12
+ private readonly collection : Collection ,
12
13
private readonly name : string ,
13
14
private readonly definition : Document
14
15
) {
You can’t perform that action at this time.
0 commit comments