MCPcopy
hub / github.com/mongodb/node-mongodb-native / findOneAndUpdate

Method findOneAndUpdate

src/collection.ts:1036–1050  ·  view source on GitHub ↗
(
    filter: Filter<TSchema>,
    update: UpdateFilter<TSchema> | Document[],
    options?: FindOneAndUpdateOptions
  )

Source from the content-addressed store, hash-verified

1034 update: UpdateFilter<TSchema> | Document[]
1035 ): Promise<WithId<TSchema> | null>;
1036 async findOneAndUpdate(
1037 filter: Filter<TSchema>,
1038 update: UpdateFilter<TSchema> | Document[],
1039 options?: FindOneAndUpdateOptions
1040 ): Promise<WithId<TSchema> | ModifyResult<TSchema> | null> {
1041 return await executeOperation(
1042 this.client,
1043 new FindOneAndUpdateOperation(
1044 this as TODO_NODE_3286,
1045 filter,
1046 update,
1047 resolveOptions(this, options)
1048 ) as TODO_NODE_3286
1049 );
1050 }
1051
1052 /**
1053 * Execute an aggregation framework pipeline against the collection, needs MongoDB \>= 2.2

Callers 15

operations.tsFile · 0.80
find.test.tsFile · 0.80
insert.test.tsFile · 0.80
crud_api.test.tsFile · 0.80
driver.test.tsFile · 0.80
sort.test-d.tsFile · 0.80

Calls 2

executeOperationFunction · 0.90
resolveOptionsFunction · 0.90

Tested by 1

testFindOneAndUpdateFunction · 0.64