-
Hello everyone, Could someone please post an example of how to use 'where' 'in' query for Local and REST API? Say I want to get 2 categories with specific IDs from the 'categories' collection. With local API this is what I am trying to do:
Result: it gives me all the categories from the collection. What am I doing wrong? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hey @vstarush — I can help here. Your syntax is right. Running a similarly formatted query against the new beta version of Payload returns 2 documents as expected. What version of Payload are you on? Can you try updating Payload to the most recent beta to re-try your test? The current beta, due to be released shortly, has fixed a few bugs due to querying by ID that arose from a new feature that we released a few versions back which allows users to define their own IDs for documents. Let me know if the new beta fixes it! |
Beta Was this translation helpful? Give feedback.
-
Hi jmikrut! Yes, thank you, the version had solved the issue. I was on 0.12.3 and it didn't work, but the 0.12.10-beta.0 works for Local API. Thank you! :) Do REST queries support 'in'/'not_in'? I tried this, but it didn't work: |
Beta Was this translation helpful? Give feedback.
-
Hi @jmikrut Yep, I was away and missed the .11, but installed the .13 now. All works! :) Thanks so much for your help with this!! |
Beta Was this translation helpful? Give feedback.
Hey @vstarush — I can help here.
Your syntax is right. Running a similarly formatted query against the new beta version of Payload returns 2 documents as expected.
What version of Payload are you on? Can you try updating Payload to the most recent beta to re-try your test? The current beta, due to be released shortly, has fixed a few bugs due to querying by ID that arose from a new feature that we released a few versions back which allows users to define their own IDs for documents.
Let me know if the new beta fixes it!