A materialized Document with a name. Specific AccessProviders, Collections, Databases, Functions, etc. that include user defined data are modeled with a NamedDocument.

The example below retrieves a NamedDocument for a hypothetical "Users" collection.

 const response = await client.query(fql`
Users.definition
`);
const userCollectionNamedDocument = response.data;

const indexes = userCollectionNamedDocument.indexes;

All of the named Documents can have optional, user-defined data. The generic class lets you define the shape of that data in a typesafe way

 type CollectionMetadata = {
metadata: string
}

const response = await client.query<NamedDocument<CollectionMetadata>>(fql`
Users.definition
`);
const userCollection = response.data;

const metadata = userCollection.data.metadata;

https://docs.fauna.com/fauna/current/reference/fql_reference/types#special

Type Parameters

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

coll: Module
data: T
name: string

Methods