
I am having a database with collections as : Countries, Categories, SubCategories, Posts
My posts collection has attributes as: countryID, categoryID, subCategoryID, title, Image, content
Now if I have to query a list of posts it returns data like {[{'countryID': 'countryUniqueID','categoryID' : 'categoryUniqueID', 'subCategoryID': 'subCategoryUniqueID', 'title': 'Post Title', 'content': 'post content ......' },...]}
Here I got id's for country, category and sub category. Instead of getting id's I want to get names for them. NOTE: I don't wanna use relationships as they are experimental and I am working on a realtime production ready application. What are the other alternatives for getting desired results.

is there anyone who knows about this?

The only way to get the names in the response direct from Appwrite would be to either store the names in the collections, or with Relationships

Your only other option is to take the response youβre currently getting and make new requests for each of those IDs

If you donβt want to do that on the client side, you could put it into a Function

I think using direct names is not a good practice. Relationships are not mature yet. And the third one using functions is okey but is not it a bad practice to query for every id means i have to loop the list of post documents and for every post again i run queries to get data from other collections is not it a bad one

Of course, none of the options are ideal - but there isn't any other way currently, I'm afraid. This is exactly what Relationships was created for, but if you don't want to use them yet, you don't really have many other options

The reason for not choosing relationships is that they don't support queries and also they are still experimental.
Please if someone knows about when we can expect the relationships to be fully stable. Because they are the backbone of any live app.

Anyone from core team, please throw some light on this issue. Because its a biggest nightmare for our team.

i can't say when exactly. probably not for a (minor) release or 2. it all depends on whether we find more bugs.

for now, i would recommend manually handling the relationships yourself by fetching the related documents after fetching from the primary collection.
after fetching the related collections, i highly recommend convering the response to a hash where the key is the ID and the value is the document. This will allow you to quickly look up the related document when you're iterating over your primary collection.
for example:

Thank you @Steven. One more thing, Should we create server side functions or achieve it simply through client side. Which one is best optimized for appwrite.

Kindly add it to closest roadmap. And please also share the link if any for upcoming updares/changes in appwrite. So that we can directly track and vote for features.

I would just do it client side

We don't have a public roadmap yet...we're still figuring that out

[SOLVED] Querying data from a collection that depends on other collections!
Recommended threads
- Invalid relationship value. Must be eith...
I'm getting this error when i try to update a document. The collection has a relatipship with 2 other collections. I don't understand why, when i update the doc...
- How do I do this. Please help!
Hey guys! Okay AI can't help so I'm asking real people now. π Anyway I wanted to know how one solve this in Appwrite right now. So I have a form where I wante...
- Delete account on authentication
I'm building an authentication that need to a user a choice of delete their account when they need and on the documentation, if I find delete sessions or sessio...
