Blank screen when filtering a collection for certain array values with "equals" instead of "is in"

Open
#15,387 5 comments 2 reactions 1 assignee View on GitHub

@JarrodMFlesch is already working on this.

Since Jan 28, 2026.

Assessment

This issue has not been assessed yet.

Description

area: ui Bug
Describe the Bug

When I try to filter a collection on a property that is a hasMany relation and use the "equals" operator I get a blank screen and the following error:

[Error: Failed query: select distinct "users"."id", "users"."created_at", "users"."created_at" from "users" left join "users_rels" "4f704f54_123f_4661_90e5_71f0edee30e2" on ("users"."id" = "4f704f54_123f_4661_90e5_71f0edee30e2"."parent_id" and "4f704f54_123f_4661_90e5_71f0edee30e2"."path" like $1) left join "interests" "f1c01e26_80fb_4c44_9c38_5b99a8ce7377" on "f1c01e26_80fb_4c44_9c38_5b99a8ce7377"."id" = "4f704f54_123f_4661_90e5_71f0edee30e2"."interests_id" where "4f704f54_123f_4661_90e5_71f0edee30e2"."interests_id" = $2 order by "users"."created_at" desc limit $3
params: interests,2,2,10] {
query: 'select distinct "users"."id", "users"."created_at", "users"."created_at" from "users" left join "users_rels" "4f704f54_123f_4661_90e5_71f0edee30e2" on ("users"."id" = "4f704f54_123f_4661_90e5_71f0edee30e2"."parent_id" and "4f704f54_123f_4661_90e5_71f0edee30e2"."path" like $1) left join "interests" "f1c01e26_80fb_4c44_9c38_5b99a8ce7377" on "f1c01e26_80fb_4c44_9c38_5b99a8ce7377"."id" = "4f704f54_123f_4661_90e5_71f0edee30e2"."interests_id" where "4f704f54_123f_4661_90e5_71f0edee30e2"."interests_id" = $2 order by "users"."created_at" desc limit $3',
params: [Array],
[cause]: [error: invalid input syntax for type integer: "{"2","2"}"] {
length: 152,
severity: 'ERROR',
code: '22P02',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: "unnamed portal parameter $2 = '...'",
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'numutils.c',
line: '616',
routine: 'pg_strtoint32_safe'
}
}

Link to the code that reproduces this issue

https://github.com/jaymaycry/payload-array-filter-issue

Reproduction Steps
  1. Login and create user
  2. Create one or two interests and link one to the user
  3. Go to collection and add a filter "Interests" "equals" and one of the created interests
    => menu dissapears
Which area(s) are affected?

area: ui

Environment Info
Binaries:
  Node: 22.22.0
  npm: 10.9.4
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  payload: 3.72.0
  next: 15.4.10
  @payloadcms/db-postgres: 3.72.0
  @payloadcms/drizzle: 3.72.0
  @payloadcms/graphql: 3.72.0
  @payloadcms/next/utilities: 3.72.0
  @payloadcms/richtext-lexical: 3.72.0
  @payloadcms/translations: 3.72.0
  @payloadcms/ui/shared: 3.72.0
  react: 19.2.1
  react-dom: 19.2.1
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:40 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from payloadcms/payload

All issues in payloadcms/payload

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.