ยฉ 2026 Hedgehog Software, LLC
read
ShoppingCart
id
ShoppingCartLineItems
{ "tables": [ { "name": "ShoppingCarts", "columns": [ { "name": "customerId", "type": "string" } ], "revLinks": [ { "column": "shoppingCart", "table": "Users" }, { "column": "shoppingCart", "table": "ShoppingCartLineItems" } ] }, { "name": "ShoppingCartLineItems", "columns": [ { "name": "shoppingCart", "type": "link", "link": { "table": "ShoppingCarts" } }, { "name": "productId", "type": "string" }, { "name": "quantity", "type": "int" }, { "name": "type", "type": "string", "defaultValue": "product" } ] } ] }
const record = await xata.db.ShoppingCarts.select([{ name: "<-ShoppingCartLineItems.shoppingCart", columns: ["productId", "quantity", "type"], as: "lineItems" }]).filter({ id: "rec_cno400v3e8os6tplq4jg"}).getFirstOrThrow()
record
lineItems