I am storing an array of objects in firebase and using the push method from the server as seen below:
firebaseRef.child('colors').push(body, (error) => {
if(error) {
res.send(500, error);
}
else {
res.send(200);
}
return next();
});
And on the client I am using:
model() {
return this.store.findAll('color');
}
I have an operation where I want to clear the array and I'm currently using set([]) as seen below:
firebaseRef.child('colors').set([], (error) => { ... });
If I look at the data from the management portal I can see the colors node and all elements are removed; however, the ember client still shows all the items in the array. Even after I add an item to the array to make it a length 1 it would still show perhaps 24 if it had 23 previously. It is only after I completely refresh the client does it properly recognize the length of the array.
How do I reset the array in a way which the client stays synchronized without having to remove each element one by one?
--
You received this message because you are subscribed to the Google Groups "Firebase + EmberJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-embe...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.