Skip to content

Commit 3c8fd8b

Browse files
added documentation and explicit removal of write/readConcern in listSearchIndexes collection helper
1 parent 7aa7c86 commit 3c8fd8b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/collection.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ 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.
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).
10561056
*
10571057
* @remarks Only available when used against a 7.0+ Atlas cluster.
10581058
*/
@@ -1061,7 +1061,7 @@ export class Collection<TSchema extends Document = Document> {
10611061
* Returns all search indexes for the current collection.
10621062
*
10631063
* @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.
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).
10651065
*
10661066
* @remarks Only available when used against a 7.0+ Atlas cluster.
10671067
*/
@@ -1072,7 +1072,10 @@ export class Collection<TSchema extends Document = Document> {
10721072
): ListSearchIndexesCursor {
10731073
options =
10741074
typeof indexNameOrOptions === 'object' ? indexNameOrOptions : options == null ? {} : options;
1075+
1076+
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
10751077
const cleanedOptions = (({ readConcern, writeConcern, ...rest }) => rest)(options);
1078+
10761079
const indexName =
10771080
indexNameOrOptions == null
10781081
? null

0 commit comments

Comments
 (0)