var q=new Parse.Query(‘myClass’)
q.subscribe().then(data=>{
console.log(data)
data.on(‘update’,(data2)=>{console.log(data2)})
})
i want know which filed has change
What are the ways to get it?
var q=new Parse.Query(‘myClass’)
q.subscribe().then(data=>{
console.log(data)
data.on(‘update’,(data2)=>{console.log(data2)})
})
i want know which filed has change
var q = new Parse.Query('myClass')
q.subscribe().then(data => {
data.on('update', (object, original) => {
const keysChanged = [];
for (const key of Object.keys(object.toJSON())) {
if (object.get(key) !== original.get(key)) {
keysChanged.push(key);
// you might need further equality testing if object.key is a date or object
}
}
console.log(`keys changed: ${keysChanged.join(',')}`);
});
});
thank you very much!