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

Method replaceOne

types/models.d.ts:1218–1218  ·  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

1216
1217 /** Creates a `replaceOne` query: finds the first document that matches `filter` and replaces it with `replacement`. */
1218 replaceOne<ResultDoc = THydratedDocumentType>(
1219 filter?: QueryFilter<TRawDocType>,
1220 replacement?: TRawDocType | AnyObject,
1221 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