* 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
)
| 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 |