Key Value pairs and how they are listed in the Database

Hello @David_Thompson, you can store the “dimension” data as an object or an array depending upon the use case (that is what kind of data you are storing and how you are querying it).

In case the dimension’s properties are the same for all the products, you can store like this as an object to group the related data:

dimension: {
    length: 10.2,
    width: 18.0,
    height: 5.77,
    weight: 8.0
}

In case of having different dimension properties for the products then you can apply the Attribute Pattern to store the data in an array field of objects. Each object is a key-value pair as below:

dimensions: [
    { k: "length", v: 12.7 },
    { k: "width", v: 15.0 },
    // other k-v pairs
]
1 Like