I try to put document id in an field of document in android sdk
Hey could you please explain the issue, I don't think I understood
If you mean generate a unique id you can use this
ID.unique(),
For more details look here
https://appwrite.io/docs/getting-started-for-android#makeRequest
If I use ID.unique() the result is String = "unique()"
And I need something like this 64095923cf64fe976024
Isn't a issue I need to put in a id filed the same documentId value
This is the expected behavior. When unique()
is processed by the server, it's converted to a unique id like 64095923cf64fe976024
ok but is converted in the same unique code, because I need it to be the same code (documentID with my id field)
Do I understand correctly you need attribute on a document which holds the same value as the document ID?
Why do you need that? When reading documents, you can access document if under .$id
.
yes
i resolved this with UUID it's ok
It's possible to put query on realtime?
There are multiple channels you can subscribe to regarding realtime: https://appwrite.io/docs/realtime#channels
Querying isn't really possible, but you can simply subscribe to all document changes. Then, when payload arrives, you can use if
statements to filter out those you don't want.
No need to be worried about performance/network too much, as you only get realtime updates about documents you have read permissions to.
Alternativelly, you could do listDocuments
query to get IDs of documents you are looking for. Then, subscribe to only those documents. Might be viable depending on your use case
and realtime is called for each colletion update?
Depending on what you listen to. You can listen to collection changes, collection creation, document changes, functions, executions.. There is a lot you can subscribe to
And if I want to listener all documents it's ok "databases.${db_id}.collections.${ads_id}.documents.*?
I don't receive documents
And if I want to listener all documents it's ok "databases.${db_id}.collections.${ads_id}.documents.*?
You need to use those channels
Thx
[SOLVED] How to generate id like admin dashboard in android sdk
Recommended threads
- Deep Linking & Password reset
I am using react native with expo. I want to implement deep link with the url recived via email. So when clicked the link it opens my app. I havent ever used de...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- My organization's project is blocked
My organization's project is blocked so unblocked my organization then I will this