
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
- My collection is not updating after csv ...
- phantom relationships appear on parent c...
i have this bug were my past deleted collection apears as relationship to my parent collection. when i try to delete that relationship from parent it gives me e...
- Attributes Problem - Cloud
I am not able to see the attribute columns and their context on cloud. Can you help?
