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

Method replaceOne

src/collection.ts:423–432  ·  view source on GitHub ↗

* Replace a document in a collection with another document * * @param filter - The filter used to select the document to replace * @param replacement - The Document that replaces the matching document * @param options - Optional settings for the command

(
    filter: Filter<TSchema>,
    replacement: WithoutId<TSchema>,
    options?: ReplaceOptions
  )

Source from the content-addressed store, hash-verified

421 * @param options - Optional settings for the command
422 */
423 async replaceOne(
424 filter: Filter<TSchema>,
425 replacement: WithoutId<TSchema>,
426 options?: ReplaceOptions
427 ): Promise<UpdateResult<TSchema>> {
428 return await executeOperation(
429 this.client,
430 new ReplaceOneOperation(this.s.namespace, filter, replacement, resolveOptions(this, options))
431 );
432 }
433
434 /**
435 * Update multiple documents in a collection

Callers 11

operations.tsFile · 0.45
crud_api.test.tsFile · 0.45
replaceDocumentsFunction · 0.45
bulk.test.tsFile · 0.45
testFunction · 0.45
sort.test-d.tsFile · 0.45
replaceX.test-d.tsFile · 0.45

Calls 2

executeOperationFunction · 0.90
resolveOptionsFunction · 0.90

Tested by 2

replaceDocumentsFunction · 0.36
testFunction · 0.36