how do i can detect when client connects via liveQuery to parse server. I want to updata some data in MongoDB on client's Disconnect Event by Server. Log display on Server but how i can call some function after detection of this event.
I am using self hosted Parse SErver.

thanks in advance
Here you go:
Parse.Cloud.onLiveQueryEvent( ({event, clients, subscriptions, error}) => {
if (event !== 'ws_disconnect') {
return;
}
// Do your magic
});
In case you were wondering, these are the currently emitted events:
"connect" differs from "ws_connect", the former means that the client completed the connect procedure as defined by Parse livequery protocol, where "ws_connect" just means that a new websocket was created.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With