Michal SrbM
Convex Community3y ago
2 replies
Michal Srb

v.array schema validator semantics

@zid asked:

Question about defining arrays in schemas.

Will the following allow for an empty array of items/objects?
If not, how do I write the schema so that I can a default value of an empty array?
Also would like to confirm if the below allows for a dynamic number of array items.

arrayItems: v.array(v.object({id: v.string(), title: v.string()}) )
Was this page helpful?