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

Method updateOne

src/collection.ts:405–414  ·  view source on GitHub ↗

* Update a single document in a collection * * The value of `update` can be either: * - UpdateFilter<TSchema> - A document that contains update operator expressions, * - Document[] - an aggregation pipeline. * * @param filter - The filter used to select the document to update *

(
    filter: Filter<TSchema>,
    update: UpdateFilter<TSchema> | Document[],
    options?: UpdateOptions & { sort?: Sort }
  )

Source from the content-addressed store, hash-verified

403 * @param options - Optional settings for the command
404 */
405 async updateOne(
406 filter: Filter<TSchema>,
407 update: UpdateFilter<TSchema> | Document[],
408 options?: UpdateOptions & { sort?: Sort }
409 ): Promise<UpdateResult<TSchema>> {
410 return await executeOperation(
411 this.client,
412 new UpdateOneOperation(this.s.namespace, filter, update, resolveOptions(this, options))
413 );
414 }
415
416 /**
417 * Replace a document in a collection with another document

Callers 15

operations.tsFile · 0.45
collection.test.tsFile · 0.45
testFunction · 0.45
uri.test.tsFile · 0.45
find.test.tsFile · 0.45
insert.test.tsFile · 0.45
crud_api.test.tsFile · 0.45

Calls 2

executeOperationFunction · 0.90
resolveOptionsFunction · 0.90

Tested by 4

testFunction · 0.36
testFunction · 0.36
updateEmployeeInfoFunction · 0.36
updateEmployeeInfoFunction · 0.36