[Solved] how can i get the count of key , value pair in firebase? [closed]


you can count children this way.

databaseRef.addListenerForSingleValueEvent(new ValueEventListener() {
    @Override
    public void onDataChange(DataSnapshot dataSnapshot) {
        for (DataSnapshot snap: dataSnapshot.getChildren()) {
            Log.e(snap.getKey(),snap.getChildrenCount() + "");
        }
    }

    @Override
    public void onCancelled(DatabaseError databaseError) {

    }
});

1

solved how can i get the count of key , value pair in firebase? [closed]