With the multi-location update we can update multiple path as an atomic transaction. This works fine:
var companiesPath = 'companies';
var usersPath = 'users';
var data = {};
data[companiesPath] = {'foo':'baz'};
data[usersPath] = {'name': 'John'};
firebase.update('/', data);
Now I want to do "multi-location remove" as explained here (at the end):
https://gist.github.com/davidgilbertson/afe0dcb8ce0b9879de2c8cd8ffc0c816
But I'm unable to put it to work. Any idea of what could be going wrong?
Thanks.
Ok, it is possible to do "multi-location remove". Instead of using null, we need to use {}.
The following code doesn't work:
var data = {};
data[companiesPath] = null;
data[usersPath] = null;
firebase.update('/', data);
This one works:
var data = {};
data[companiesPath] = {};
data[usersPath] = {};
firebase.update('/', data);
Reopening as we may consider making this work with null as well.