
Hello I’m new here so hi again 👋 I’m trying to use realtime to check if new content created or content deleted in the db live.
I used : realtime.subscribe {response in print(response.events)} and I don’t understand why it’s events and not event I checked if it’s end with update/create/delete and I’m checking only events.first! I’m missing data with my approach?

It throws an event each time it changes. First request you will need to get data manually like no real-time data. After that, such method will be triggered with the corresponding data

Thank you for your answer! I have method triggered each time on the first event of the events array it’s working but I’m not pretty sure I did it right so When the subscription is triggered live with delete/update/create… its create array of events for example like that :

{ "events": [ "databases.default.collections.movies.documents.lion-king.create", "databases..collections..documents..create", "databases.default.collections..documents.lion-king.create", "databases..collections..documents.lion-king.create", "databases..collections.movies.documents.lion-king.create", "databases.default.collections.movies.documents..create", "databases..collections.movies.documents..create", "databases.default.collections..documents..create", "databases.default.collections.movies.documents.lion-king", "databases..collections..documents.", "databases.default.collections..documents.lion-king", "databases..collections..documents.lion-king", "databases..collections.movies.documents.lion-king", "databases.default.collections.movies.documents.", "databases..collections.movies.documents.", "databases.default.collections..documents.", "databases.default.collections.movies", "databases..collections.", "databases.default.collections.", "databases..collections.movies", "databases.default", "databases.*" ] }

And my code read only the first one events.first and find out what the last 6 digits are and fire the right method for it That’s good or bad?

If you don't need everything it will be better to discard the other events and only get latest

Got it solved thanks !

[SOLVED] RealTime subscription
Recommended threads
- Why "You’ve reached the limit for your G...
Why did Appwrite send me this alert when the usage reached 10605%? Is it too late? Why not when reached 100% usage? And I can not pay for more usage described ...
- Subdomain failed verification
So I wanted to do a custom subdomain, because local storage doesn't work for me, but I've tried it a long time ago, it didn't work for me, and now I'm trying ag...
- Sites 30MB limit from GitHub
I’m deploying a site from github as Other type on the Hobby plan. It is actually a Flutter web app but it’s in a subdirectory with the root being an html landin...
