Skip to content

Commit 59ed066

Browse files
omit readconcern and writeConcern
1 parent 7cc6072 commit 59ed066

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/collection.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,38 +1052,40 @@ export class Collection<TSchema extends Document = Document> {
10521052
/**
10531053
* Returns all search indexes for the current collection.
10541054
*
1055-
* @param options - The options for the list indexes operation. This method will ignore 'readConcern' and 'writeConcern' keys if they are present in 'options' (since there is no Atlas support).
1055+
* @param options - The options for the list indexes operation.
10561056
*
10571057
* @remarks Only available when used against a 7.0+ Atlas cluster.
10581058
*/
1059-
listSearchIndexes(options?: ListSearchIndexesOptions): ListSearchIndexesCursor;
1059+
listSearchIndexes(
1060+
options?: Omit<ListSearchIndexesOptions, 'readConcern' | 'writeConcern'>
1061+
): ListSearchIndexesCursor;
10601062
/**
10611063
* Returns all search indexes for the current collection.
10621064
*
10631065
* @param name - The name of the index to search for. Only indexes with matching index names will be returned.
1064-
* @param options - The options for the list indexes operation. This method will ignore 'readConcern' and 'writeConcern' keys if they are present in 'options' (since there is no Atlas support).
1066+
* @param options - The options for the list indexes operation.
10651067
*
10661068
* @remarks Only available when used against a 7.0+ Atlas cluster.
10671069
*/
1068-
listSearchIndexes(name: string, options?: ListSearchIndexesOptions): ListSearchIndexesCursor;
1070+
listSearchIndexes(
1071+
name: string,
1072+
options?: Omit<ListSearchIndexesOptions, 'readConcern' | 'writeConcern'>
1073+
): ListSearchIndexesCursor;
10691074
listSearchIndexes(
10701075
indexNameOrOptions?: string | ListSearchIndexesOptions,
1071-
options?: ListSearchIndexesOptions
1076+
options?: Omit<ListSearchIndexesOptions, 'readConcern' | 'writeConcern'>
10721077
): ListSearchIndexesCursor {
10731078
options =
10741079
typeof indexNameOrOptions === 'object' ? indexNameOrOptions : options == null ? {} : options;
10751080

1076-
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
1077-
const { readConcern, writeConcern, ...cleanedOptions } = options;
1078-
10791081
const indexName =
10801082
indexNameOrOptions == null
10811083
? null
10821084
: typeof indexNameOrOptions === 'object'
10831085
? null
10841086
: indexNameOrOptions;
10851087

1086-
return new ListSearchIndexesCursor(this as TODO_NODE_3286, indexName, cleanedOptions);
1088+
return new ListSearchIndexesCursor(this as TODO_NODE_3286, indexName, options);
10871089
}
10881090

10891091
/**

0 commit comments

Comments
 (0)