Gelo
07/12/2021, 5:16 PMRyan
07/13/2021, 6:06 AMundefined
in this case doesn’t mean undefined properties. It means that you have not passed any value to where
. In this case, this query will be the equivalent of:
prisma.model.deleteMany({ where: {} })
Both of the above queries are equivalent so it will delete all the values present in the database.Ryan
07/13/2021, 6:07 AMname
is defined and only delete those. If you want to delete those records whose name is null
then you need to use null
instead like this:
prisma.model.deleteMany({
where: { name: null }
})
Gelo
07/13/2021, 6:20 AM