method

RiduClient.update

Update one document, optionally guarded by its revision.

Arguments

ArgumentTypeDescription
collectionSlugThe collection value.
idstringThe id value.
dataDraftUpdateFor<Config, Slug>The data value.
optionsMutationOptions<LocaleFor<Config>> & { draft?: true; } & { draft: true; }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>>

Source packages/sdk/src/types.ts:1145

Related types