Skip to content

Can't filter by null values on JSONB fields #8399

Closed

Description

@benedyktdryl

Bug description

Can't filter by null values on JSONB fields

How to reproduce

  1. Run query with null value filter
prisma.model.findMany({
  where: {
    NOT: {
      data: {
        path: ["foo"],
        equals: null,
      },
    },
  },
});
  1. See error:

Argument equals for where.NOT.0.data.equals must not be null. Please use undefined instead.

Expected behavior

As JSONB values are allowed, I should be able to find values filtered by null.

Prisma information

model model {
  id               String            @id @db.Uuid
  data             Json
}

Environment & setup

  • OS: MacOS
  • Database: PostgreSQL
  • Node.js version: 14.x

Prisma Version

`"@prisma/client": "^2.20.1"`

Metadata

Metadata

Labels

bug/2-confirmedkind/bugtopic: filterJsontopic: where / filter

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions