Realtime queries - do they work on response.events or only on response.payload?
- 0
- Self Hosted
- Realtime
The current Realtime Queries docs are not very clear on the subject - when using queries to filter the subscription results, can we query on the response.events list or is the query applied only on the response.payload object?
All examples in the doc seem to use payload properties so it's not clear to me if I can filter by event.
https://appwrite.io/docs/apis/realtime/queries https://appwrite.io/blog/post/announcing-realtime-queries
Hey, it's on the payload But you can subscribe to the action channels as well
Yes, I am subscribing to Channel.tablesdb('<DATABASE_ID>').table('<TABLE_ID>').row() but only want to get notified on the databases.*.tables.*.rows.*.create, databases.*.tables.*.rows.*.update, and databases.*.tables.*.rows.*.upsert events. It seems I still need to filter those in the client code, cannot use a query for that.
lets try subscribing to this only Channel.tablesdb('sdf').table('df').row().create()
wow, I missed that I can do that. but does that mean I would need 3 separate subscriptions, i.e. 3 separate websocket connections?
no, its a subscription
If you are on cloud and using the new sdk, then Appwrite realtime works on a message based subscription and everything is incremental over a single socket
You can subscribe , unsubscribe, update to a subscribe and everything all on a single connection via message
I'm on self-hosted but I hope it works the same on self-hosted?
Ah okay then its going to give a bit of hunch cause these are all recently added and will be available on the next self-hosted release
then the best way is to use the manual filtering
you mean 1.9.1?
Not sure You will be notified when released but yeah on the very next release
ok, thank you very much for your help!
Recommended threads
- Export, Import or Migration giving this ...
As you can see in yhe screenshot i am not able to export any data or export the data from tables. Also it is affecting the migration from appwrite to appwrite h...
- local (self-hosted) sites issues
setup: - `composer run installer:dev` issues - Getting error when visiting the site ```Synchronous function execution timed out. Use asynchronous execution in...
- I'm getting an error on the console "j?....
On my self hosted instance version 1.8.1 the console is giving me this error when trying to view the rows for a table I recently created. My application is read...