-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Description
Description
I wanna filter my api by nullable values, and possibly by not nullable values as well.
I would like to do similar to typeORM IsNull:
const users = await userRepository.findBy({
joinedAt: IsNull(),
})
Version
postgres 16
"json-api-nestjs": "^7.0.3",
"@nestjs/typeorm": "^10.0.2",
"typeorm": "^0.3.20"
Tries
Try 1
API:
http://localhost:3000/user?filter[joinedAt][eq]=null
QUERY:
SELECT COUNT(1) AS "cnt" FROM "users" "User" WHERE ( "User"."joined_at" = $1 ) AND ( "User"."deleted_at" IS NULL ) -- PARAMETERS: [null]
Try 2
API:
http://localhost:3000/user?filter[joinedAt][eq]=true
QUERY:
[2024-10-21T18:31:07.480Z][QUERY]: SELECT COUNT(1) AS "cnt" FROM "users" "User" WHERE ( "User"."joined_at" = $1 ) AND ( "User"."deleted_at" IS NULL ) -- PARAMETERS: ["true"]
Try 3
http://localhost:3000/user?filter[joinedAt][regexp]=^$
QUERY:
[2024-10-21T18:32:00.636Z][QUERY]: SELECT COUNT(1) AS "cnt" FROM "users" "User" WHERE ( "User"."joined_at" ~* $1 ) AND ( "User"."deleted_at" IS NULL ) -- PARAMETERS: ["^$"]
Am I doing anything wrong when querying it for null
values or missing something?
Appreciate your help.
Metadata
Metadata
Assignees
Labels
No labels