How can in a single query create a resource like t...
# orm-help
h
How can in a single query create a resource like the below, and if one already exists with "uuid" as specified and "deleted" bool update it instead? How to workaround that the boolean "deleted" can not be used to uniquely identify the map table?
Copy code
const result1 = await prisma.map.upsert({
            where: {
                uuid: query.uuid
                deleted: true
            },
            update: {

            },
            create: {
                user: {
                    connect: {
                        id: query.userId
                    }
                },
                uuid: query.uuid
                deleted: false
            }
}
c
Don’t think you can without dropping to raw or doing two queries sadly
👍 1
h
ok, thx 🙂