From following lots for random documentation ive managed to use Parse.Query client side which subscribes to my live query server
however i need to use masterKey but if were executing the query client side im not sure how this can be achieved, is there any examples on using a live query from cloud code and subscribing to it from client side ? so far this is what im doing clientside but it needs to be server side
chatSync = async () => {
const currentUID = this._api.current().id
const currentSession = this._api.current().getSessionToken()
const query = new Parse.Query(‘SpecialObject’).contains(‘users’, currentUID );
const subscription = await query.subscribe(currentSession);
let data: Array = ;
subscription.on(‘open’, async () => {
let results = await query.find()
let threadsParse = JSON.parse(JSON.stringify(results))
for (let index = 0; index < threadsParse.length; index++) {
const thread = threadsParse[index];
data.push({…thread})
console.log(data ${JSON.stringify(data)}
)
}
});
}