Skip to content

AttributeSchema = Readonly<Record<string, { indexed: boolean | undefined; type: TypeTag; }>>

Defined in: src/schema/attributes.ts:45

The names, types and indexing of an entity’s attributes, with no values — what the $attributeSchema selection returns. indexed is undefined when the node did not say.

It is for finding out what entities hold before fetching their values. Values can be large — a bytes attribute holds up to 128 KiB — and an RPC endpoint may cap how big a response it sends, so a page of 100 entities with every attribute can be more than it will return. The schema is a few bytes per attribute: select it for a page, then fetch the attributes you need by name, or the large ones a few entities at a time.

It also tells apart two entities that use the same name with different types, and shows which attributes are indexed, and so can be filtered on.