-
I'm trying to do the equivalent of an "in" query in Base like so:
It doesn't seem to work. The documentation makes it look like this pattern works. But maybe it doesn't work for the "key" field?
Is there another way? I'd rather not have to make multiple queries (one per array element) to get what I'm after. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
[ ❌ ] |
Beta Was this translation helpful? Give feedback.
-
To avoid multiple queries, you can create a new duplicate field for {
"key" : "0c9f904ffb9540f7a1539add854b7bc3",
"id": "0c9f904ffb9540f7a1539add854b7bc3",
"value": "Sample"
} and query them by the duplicate field. deta.Base("test").fetch([ {"id": "0c9f904ffb9540f7a1539add854b7bc3"}, {"id": "093889577a4b4955be79e8fde331720e"}]).items |
Beta Was this translation helpful? Give feedback.
[ ❌ ]
db.projects.fetch([{ "key": "key-1"}, { "key": "key-2"}.....{ "key": "key-N"}])
for reference check: https://docs.deta.sh/docs/base/queries/#equal