method
RiduClient.update
Update one document, optionally guarded by its revision.
Arguments
| Argument | Type | Description |
|---|---|---|
collection | Slug | The collection value. |
id | string | The id value. |
data | DraftUpdateFor< | The data value. |
options | MutationOptions< | The options value. |
Returns
The declared result.
Promise<OutputFor<Config, Slug>>Full signature (2 overloads)
RiduClient.update<Slug extends DraftCollectionSlug<Config>>(
collection: Slug,
id: string,
data: DraftUpdateFor<Config, Slug>,
options: UpdateOptions<LocaleFor<Config>, true> & { draft: true; },
): Promise<OutputFor<Config, Slug>>
RiduClient.update<Slug extends CollectionSlug<Config>>(
collection: Slug,
id: string,
data: UpdateFor<Config, Slug>,
options?: UpdateOptions<LocaleFor<Config>, CollectionDraftsFor<Config, Slug>>,
): Promise<OutputFor<Config, Slug>>Related types
DraftCollectionSlugCollection slugs with the generated drafts capability.
DraftUpdateForGenerated input for staging an incomplete collection working draft.
UpdateOptionsUpdating a draft-capable resource may explicitly stage a working draft.
OutputForResolve a collection document output type.
CollectionSlugThe generated union of collection slugs.
UpdateForResolve a collection update input type.
MutationOptionsLocalized mutation options with optimistic concurrency.