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
- {"code": 1008, "message": "Invalid Origi...
Nothing has changed in my application or console settings so I'm curious as to what I need to do to fix this. I already have the client registered so I'm not en...
- android platform invaild origina
It happened today suddenly. Our app says invalid origin. And appwrite cloud says every time we tried to add the app to it: "param platformId" is not optional.
- All my apps are not opening now
All my apps are not opening now 200+ apps are not opening plz fast