Is there some kind of standard, or does someone ha...
# orm-help
l
Is there some kind of standard, or does someone have a solution to adding multiple sets of fields from an object to the database that doesn't involve spamming the database with requests for each piece of data? v e.g. the "items" array is the type of data I want to pass to the "inventory", what's the best way to pass that to the "inventory.update" function without multiple requests?
Copy code
const items = [{item: "thing1", amount: 1}, {item: "thing2", amount: 2}, {item: "thing3", amount: 10}];
await prisma.inventory.update({
    where: {
        id,
    },
    data: {
        ITEM: {
            increment: AMOUNT,
        }
    }
});
👀 1
n
Hi @Lewis 👋 Did you had a look at set operator to store the entire array in one request?
v
👋 Hello @Lewis did you have chance to check Nurul's question? Let us know if this is still an open question!