Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Update null doesn't remove key on Android #229

Closed
codeback opened this issue Nov 24, 2016 · 2 comments
Closed

Update null doesn't remove key on Android #229

codeback opened this issue Nov 24, 2016 · 2 comments
Assignees
Milestone

Comments

@codeback
Copy link

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.

@codeback
Copy link
Author

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);

@EddyVerbruggen
Copy link
Owner

Reopening as we may consider making this work with null as well.

@EddyVerbruggen EddyVerbruggen added this to the 3.9.0 milestone Jan 2, 2017
@EddyVerbruggen EddyVerbruggen self-assigned this Jan 2, 2017
@EddyVerbruggen EddyVerbruggen changed the title Update null doesn't remove key Update null doesn't remove key on Android Jan 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants