Database schema for JSON like record

e.g. Velo: Working with the Data API | Help Center | Wix.com
has an example


let newCustomer = {  name: "Mary",
    age: 47,
    _id: "mary.jones@myemail.com",
    phone: "(345)123-4567",
    pic: "Mary.jpg",
    labels: ["female", "adult", "hiking"],
    relatives: ["husband", "daughter"],
    purchases: [
        {item: "watch", material: "gold", price: "2000.00"},
        {item: "ring", material: "platinum", price: "500.00"},
        {item: "bracelet", material: "silver", price: "250.00"}
    ]};

wixData.insert("Customer", newCustomer);

  1. I have a similar need. Instead of creating many databases and joins, it would be nice,
    if I also can define database schema that supported the above code sample. Looking for a way to do so.

  2. While at it also looking for any supporting docs on using such database with forms.

I see, wixData.insert() creates high level columns which holds respective JSON objects in string form, for which column isn’t already present.

Hi,
You can check out this video to learn How to Create a Custom Form & Connect It to a Database or check out this tutorial Note that once you access your DB collection and add the relevant columns, it creates the schema automatically.

Best,
Tal.