when I update an array within an object, e.g. cont...
# orm-help
m
when I update an array within an object, e.g. context.prisma.updateUser({ where: {}, data: {addresses: [address1, address2, address3] }), prisma does not delete already saved addresses which are not in that update query. Does anyone know how I could 'hard' update the address field with the updatesUser method, i.e. so that addresses not included in the update are deleted?
l
I had the same issue. Discussed here: https://www.prisma.io/forum/t/updating-a-list-within-an-entity-appends-rather-then-replaces/4396. There is an outstanding issue: https://github.com/prisma/prisma/issues/2036. My solution was to have an intermediate type that was replaced.
m
okay cool, will have a look! thanks a lot