godon019
3/28/2019 - 2:14 AM

prisma where conditions

 where: {
    pogyowon: {
      OR: [
        { id: pogyowonInfo.id, },
        { alias: pogyowonInfo.alias }
      ]
    },
\!h     name_contains: name ? name : undefined
  }
  • AND can be omitted by default
    so pogyowon && name_contains
  • if name exists, then add name to condition otherwise, not
    (use undefined not null)