Multiple Relation Row in a View, expand on a list of relations in a view #5116
Replies: 1 comment
-
Column expressions (eg. You'll have to send separate request(s) to retrieve the related user products, for example: const productIds = ["id1", "id2", "..."]
const products = await pb.collection("products").getFullList({
// filter: 'id="id1" || id="id2" || id="..."'
filter: productIds.map((id) => `id="${id}"`).join("||")
}) Depending on your use case and how do you plan to use the aggregation, another option since you want to expand the related items anyway is to not use a view and instead calculate the items you need on the client-side: const users = await pb.collection("users").getFullList({
expand: "orders_via_customer.product"
}) The above should return all users with their orders and products under the |
Beta Was this translation helpful? Give feedback.
-
Hello,
i have following tables
I want to create a View that Allows me to get a JSON object that looks like that
This behaviour is seen when creating multiple relation rows in base tables.
i want this data type in a view.
the closest i came up with was
How ever this doesnt allow me to expand on products
Kind regards
Beta Was this translation helpful? Give feedback.
All reactions