sap
sap

Reputation: 254

Live Queries subscription updates in Parse-server

Is it possible to get subscription alerts for live queries on a single client instead of everyone. I am using the following code to get update alerts for the object 'obj' on class 'class-name'. But the alert message comes on every client( i.e every instance of running app).

let query_add = new Parse.Query("class-name");
let subscription = query_add.subscribe();

subscription.on('update', (obj) => {
   alert('object updated');
});

How can I modify this to notify only the single client.

Upvotes: 2

Views: 551

Answers (1)

Sara Nafisa
Sara Nafisa

Reputation: 27

Absolutely you can specify user id you want to listen to it by adding whereEqualTo to the query.

Here an example I want to listen to specific chat messages: QueryBuilder query = QueryBuilder(Message.clone())..whereEqualTo('chatId', chatId);

Upvotes: 0

Related Questions