FindOptions
●db · /index·type
Controls how ShopService.findByDomain fetches and returns the document. Allows callers to
skip shape conversion, include sensitive credentials, or request feature-flag population in a
single call.
Properties
PROPTYPEDESCRIPTION
convert?
boolean
Whether to convert the result to the masked ``OnlineShop`` or keep the raw ``ShopBase`` doc.
populate?
string[]
Population paths (e.g. ``featureFlags.flag``). Inert on the Convex seam: the ``db/shops`` reads
always resolve the ``shopFeatureFlags`` join, so ``featureFlags[].flag`` arrives populated
whether or not this is passed. Retained for the frozen call-site signature.
projection?
Record<string,
0 | 1>Field projection (e.g. ``{ domain: 1, 'i18n.defaultLocale': 1 }``) so callers that only read a
couple of fields receive a narrow object. Include-style (``1``) paths are honored client-side;
pair with ``convert: false`` as before.
sensitiveData?
boolean
Example
import type { FindOptions } from '@nordcom/commerce-db';
const opts: FindOptions = { populate: ['featureFlags.flag'] };
const shop = await Shop.findByDomain('acme.com', opts);Related
FeatureFlagService ReviewService ShopService FeatureFlagOption FeatureFlagRef ResolvedCartLineTokens ResolvedProductCardTokens ResolvedShopTheme
FeatureFlagService
FeatureFlag service backed by the deployed db/featureflags Convex functions. Method signatures preserved from the prior Mongoosebacked service so storefront / a
FontFamilyKey
Union of valid keys. A resolved theme's typography.fontFamily / headingFamily is always one of these after narrows unrecognized values, so the storefront loader