Back

[SOLVED] is it possible to use listDocuments with a wildcard collection ID ?

  • 0
  • Databases
_alnes_
5 Sep, 2023, 13:11

I have a database with dynamically created collections. Is it possible to search for properties in all collections in this database?

thanks alnes

TL;DR
The user is asking if it is possible to use a wildcard collection ID with the `listDocuments` function. The solution is to put all the data to be searched into one collection with no duplicates in the database. The user implemented a solution using a string array and queried the properties using `Query.search`. It works fine, but the user would have preferred to use `Query.equal` and go straight to the properties. However, searching in multiple collections with a wildcard collection ID is not currently possible. It is only possible to search in one collection.
ideclon
5 Sep, 2023, 14:54

No

joeyouss
5 Sep, 2023, 15:13

No, not currently. You can only search in one collection

Drake
5 Sep, 2023, 19:12

[SOLVED] is it possible to use listDocuments with a wildcard collection ID ?

Camo
5 Sep, 2023, 19:27

you can list all collections, then search in all collections and agregate the results

_alnes_
6 Sep, 2023, 12:11

That's what I thought too, it just doesn't seem too performant to me. Luckily, I found a solution to put all the data to be searched into one collection - with no duplicates in the database. But suffer with string array and then IDs there - is searched with Query.search. It works fine, I would have preferred to use Query.equal and go straight to the properties....

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more