method

RiduClient.find

Find one authorized document with a locale-, projection-, and population-dependent result.

Arguments

ArgumentTypeDescription
collectionSlugThe collection value.
idstringThe id value.
optionsOptions | undefinedThe options value.

Returns

The declared result.

Promise<LocaleResult<ApplySelect<ApplyPopulate<OutputFor<Config, Slug>, OptionProperty<Options, "populate">, never>, OptionProperty<Options, "select">>, ApplySelect<ApplyPopulate<AllLocalesOutputFor<Config, Slug>, OptionProperty<Options, "populate">, LocaleFor<Config>>, OptionProperty<Options, "select">>, Options>>

Full signature

RiduClient.find< Slug extends CollectionSlug<Config>, const Options extends FindOptions< SelectFor<Config, Slug>, PopulateFor<Config, Slug>, LocaleFor<Config>, CollectionDraftsFor<Config, Slug>, > | undefined = undefined, >( collection: Slug, id: string, options?: Options, ): Promise<CollectionQueryResult<Config, Slug, Options>>

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

Related types

  • CollectionSlug

    The generated union of collection slugs.

  • FindOptions

    Projection, population, depth, and locale options for one document or global.

  • SelectFor

    Resolve a collection projection type.

  • PopulateFor

    Resolve a collection population type.

  • OutputFor

    Resolve a collection document output type.

  • AllLocalesOutputFor

    Resolve locale-keyed collection output when generated, otherwise ordinary output.