Android Question

Delete Node with given id but unknown node id in Firebase

I have a firebase data structure which looks like this:

| |---group1
| | |---membernames
| | |---xy_unknownid
| | |---givenname: "userx"
| | |---tv_unknownid
| | |---givenname: "usery"

Now I want to delete the node xy_unknownid. But I only know the "givenname": userx.

I tried to delete the node with:


but this won't work because "Invalid Firebase Database path: $member. Firebase Database paths must not contain '.', '#', '$', '[', or ']'"

So my question is, how can I delete the node: "xy_unknownid" only knowing: "userx".

Thanks in advance.

Answer Source

Try this code and tell me if this works,

mFirebaseDatabaseReference.child("groups").child("group1").child("membernames").addListenerForSingleValueEvent(new ValueEventListener() {
   public void onDataChange(DataSnapshot snapshot) {
      for(DataSnapshot dataSnapshot1:snapshot.getChildren())

   public void onCancelled(FirebaseError firebaseError) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download