Theo's Typesafe CultTTC
Theo's Typesafe Cult4y ago
4 replies
Lopen

does null get overlooked during prisma update

Example

await ctx.prisma.user.update{
     data: {
         ...input
         age: input.age ? input.age : null
         position: input.position ? input.position : null
        }
  }


So basically my questions are
1) if age already has a value and input.age doesn't have any value will this override what's there and put null or prisma will skip the update of age because null was provided

2) if undefined or null is provided will this trigger an update or prisma is smart enough to skip it?
Was this page helpful?