payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
23.58k stars 1.5k forks source link

Trouble with REST API endpoint behavior for fetching images related to multiple tags in PostgreSQL #5486

Open azoom-keishi-ichida opened 6 months ago

azoom-keishi-ichida commented 6 months ago

Link to reproduction

No response

Describe the Bug

Hello,

I'm using PostgreSQL and have set up tables for images and tags with a many-to-many relationship. When trying to fetch images related to multiple tags, I encountered an issue with a specific query parameter not behaving as expected in the REST API endpoint.

http://localhost:3000/api/images?where[tags.title][all]=hugahuga,hogehoge

I noticed that [all] is not functioning properly, while [in] works correctly in the given context.

I would appreciate any insights or advice on resolving this issue. I'm looking for guidance on how to make [all] function as intended.

Your support in troubleshooting this would be greatly appreciated. Thank you in advance for any assistance you can provide.

To Reproduce

1.0.0

Adapters and Plugins

No response

azoom-keishi-ichida commented 6 months ago

I understood from the following code that searching with all is not possible in PostgreSQL. When will all be available in PostgreSQL, and are there any plans for it? Also, are there any other methods to achieve the same behavior as all?

https://github.com/payloadcms/payload/blob/916923071a2c28077326bfd2059d1665ef47e94f/packages/db-postgres/src/queries/operatorMap.ts#L17