How to retrieve multiple values from firebase database in cloud functions

0

I have the following function that I did in Java, it solves my problem, however I am wanting to play with javascript too. So I had the following problem, I only found functions that retrieve unique values, and I wanted a function similar to dataSnapshot.getChildren() that has in Java only for JavaScript, if not, what would be the alternative?

To understand better, I'll leave the Java code here that works perfectly.

mRef.addListenerForSingleValueEvent(new ValueEventListener() {
                    @Override
                    public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                        for (DataSnapshot ds : dataSnapshot.getChildren()) {
                            float okk = Float.valueOf(ds.child("value").getValue(String.class))/100000000;
                            prov += ds.child("wallet").getValue(String.class)+", "+String.format(Locale.US,"%.8f", okk)+"\n";
                            ds.getRef().removeValue();
                        }
                        tx_array.setText(prov);
                    }
                    @Override
                    public void onCancelled(@NonNull DatabaseError databaseError) {

                    }
                });

The output of the list is supposed to be

  

39Hs93m61zYCaiaNe8yzgrDcutVAz2Kgdc, 0.00151515   3QMTHAaYcQB8kJxF5nxxBwskyCFukCNH8t, 0.00151515   3AcNSeB9DX3ZKvGxMaec9uZ98rY2BJKuzW, 0.00153787   36SjF1MBm2DE6YimNYiy9T4ez6Z7UA4rpg, 0.0015409   3AHr3GF12div1Kgf6DegeiHSGQYssvbmih, 0.00162121   19vR7xchAg1vUgGwATwBsz5NYrVWYKdSQ3, 0.00164545   .   1C8rxppQk8mRSWB8xPKZ5DsYVykJBLNhV3, 0.00166212

    
asked by anonymous 11.10.2018 / 01:57

0 answers