Nativescript-plugin-firebase: Update null doesn't remove key on Android

Created on 24 Nov 2016  路  2Comments  路  Source: EddyVerbruggen/nativescript-plugin-firebase

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.

Android bug

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings