Skip to content

VexDocumentGlobal

Defined in: packages/core/src/types/generated.ts:320

Flat global document returned by globals.get and globals.find.

Extends VexDocument (inheriting _id: string and _creationTime: number) and adds _slug: TSlug as the discriminator field. The generated per-global interfaces (e.g. SiteSettingsGlobal) extend this type and add user fields.

When called with a typed TSlug, globals.get returns GlobalDocumentBySlug[TSlug] (the concrete generated interface), not this base type. This type is the fallback for unnarrowed contexts (e.g. the return of findGlobals).

const doc: VexDocumentGlobal<"siteSettings"> = ...;
doc._slug; // "siteSettings"
doc._id; // string (from VexDocument)
doc._creationTime; // number (from VexDocument)
// user fields are accessible via the index signature: doc["siteName"]

VexDocument for the base type

TSlug extends GlobalSlug = GlobalSlug

The global slug. Defaults to GlobalSlug (all slugs).

[key: string]: unknown

Field values defined by the collection schema.

_creationTime: number

Defined in: packages/core/src/api/convex.ts:26

Unix timestamp (milliseconds) when the document was created.

VexDocument._creationTime


_id: string

Defined in: packages/core/src/api/convex.ts:24

Convex document ID string.

VexDocument._id


_slug: TSlug

Defined in: packages/core/src/types/generated.ts:326

The global slug — uniquely identifies which global this document is. Renamed from slug (the DB column name) at the API layer to avoid collisions with user-defined field keys.