MCPcopy Create free account
hub / github.com/Automattic/mongoose / replaceOne

Method replaceOne

types/models.d.ts:1347–1347  ·  view source on GitHub ↗

Creates a `replaceOne` query: finds the first document that matches `filter` and replaces it with `replacement`.

(
      filter?: QueryFilter<TRawDocType>,
      replacement?: TRawDocType | AnyObject,
      options?: (mongodb.ReplaceOptions & QueryOptions<TRawDocType>) | null
    )

Source from the content-addressed store, hash-verified

1345
1346 /** Creates a `replaceOne` query: finds the first document that matches `filter` and replaces it with `replacement`. */
1347 replaceOne<ResultDoc = THydratedDocumentType>(
1348 filter?: QueryFilter<TRawDocType>,
1349 replacement?: TRawDocType | AnyObject,
1350 options?: (mongodb.ReplaceOptions & QueryOptions<TRawDocType>) | null

Callers 13

query.jsFile · 0.80
timestamps.test.jsFile · 0.80
query.test.jsFile · 0.80
model.test.jsFile · 0.80
document.test.jsFile · 0.80
gh12347Function · 0.80
gh8768Function · 0.80

Calls

no outgoing calls

Tested by 2

gh12347Function · 0.64
gh8768Function · 0.64