Back

Realtime - Listen to changes in documents

  • 0
  • Databases
  • Flutter
  • Realtime
Chandan Gowda
7 Jul, 2023, 12:05

How can we listen to changes (CRUD) in documents related to a particular index?

TL;DR
The user is asking how to listen to changes in documents related to a specific index. A possible solution is to subscribe to the `databases.[ID].collections.[ID].documents` channel and check the events to see if they match the desired criteria. Upvoting a related feature request is also suggested.
Binyamin
7 Jul, 2023, 13:52

For now the realtime channels you can subscribe are very broad ones. https://appwrite.io/docs/realtime#channels

So, for your use case you'll probably need to subscribe to the databases.[ID].collections.[ID].documents channel. Then, You can check the events to see that it matches what you're looking for.

Chandan Gowda
7 Jul, 2023, 15:04

Okay. Thanks @Binyamin

Chandan Gowda
7 Jul, 2023, 15:04

Also, is there any way to create a transaction and then execute it in one go to prevent inconsistencies ?

Binyamin
7 Jul, 2023, 15:06

Not for now, you can upvote it here: https://github.com/appwrite/appwrite/issues/2788

Chandan Gowda
7 Jul, 2023, 15:29

Okay great.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more