Skip to content

Filtering by not: null not working #2472

@DomZem

Description

@DomZem

Description and expected behavior
Current Behavior:
The { not: null } filter syntax is not working correctly in ZenStack queries. When attempting to filter for non-null values using this syntax, the query does not return the expected results. It returns empty array.

const results = await db.model.findMany({ where: { fieldName: { not: null, }, }, });

Expected Behavior:
The query should filter and return only records where fieldName is NOT NULL. As an example project I attach link: https://github.com/DomZem/zenstack-not-null. There I have a Post model with published_at DateTime? field.

Environment:

  • ZenStack version: 3.4.5
  • Database type: Postgresql
  • Node.js/Bun version: 20.19.6
  • Package manager: pnpm

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions