Meta API
The Meta API allows you to retrieve the schema for a collection
Get Schema
It is possible to retrieve the schema of a collection. This enables implementing things like dynamic forms or other dynamic pages, which rely on the schema to display different page components. Schema will be retrieved for the parent collection, and will contain the schema for all nested collections inside the parent collection.
let {data: schema} = await db.schema("chat").get()
1
2
2
Expected Response
[
{
"name": "Metadata",
"id": "_metadata",
"slug": "_metadata",
"type": 100
},
{
"name": "Name",
"id": "601184f23dabaf9fa421e43c",
"slug": "name",
"type": 1,
"required": false,
"unique": false,
"primaryField": false
}
]
```### Type Value Mapping
PlainTextType = 1
RichTextType = 2
NumberType = 3
PhoneNumberType = 4
ImageRefType = 5
ItemRefType = 6
OptionType = 7
BooleanType = 8
LinkType = 9
DateType = 10
ImageRefSetType = 11
NestedCollection = 12
GeoPointType = 13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32