Back

how to create a realtime subscription on document creation

  • 0
  • Flutter
  • Realtime
Ireneus
27 Jul, 2024, 19:11
TypeScript
        'databases.${ApiInfo.databaseidbase}.collections.${ApiInfo.collectionIdEvents}.documents.*.create'
      ]);``` thats how i subscribe but it doesnt work
TL;DR
To create a realtime subscription on document creation, developers can follow this solution: Subscribe using the correct format as shown below: ```final localtopicsubscription = ApiClient.realtime.subscribe([ 'databases.${ApiInfo.databaseidbase}.collections.${ApiInfo.collectionIdEvents}.documents.*.create' ]);```
Joshi
27 Jul, 2024, 19:12

databases.${ApiInfo.databaseidbase}.collections.${ApiInfo.collectionIdEvents}.documents

Joshi
27 Jul, 2024, 19:12

If you want to listen to any document creation in that collection

Ireneus
27 Jul, 2024, 19:13

that works for updates too i dont want to listen to updates

Joshi
27 Jul, 2024, 19:13

you can only listen to channels

Joshi
27 Jul, 2024, 19:13

not specific events

Ireneus
27 Jul, 2024, 19:14

oh rip

Ireneus
27 Jul, 2024, 19:18

is there any workaround?

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