Skip to content Skip to sidebar Skip to footer

How Do I Set Double Query Of Firebase Realtime Database?

From below query I get the data in order of timestamp Query Users = FirebaseDatabase.getInstance.getReference.child('Users').orderbychild('timestamp'); Now all children are ordere

Solution 1:

Firebase does not support multiple orderbychild method. What you can do is, first fetch records from Firebase with current user id

QueryUsers= FirebaseDatabase.getInstance.getReference.child("Users").orderbychild("CurrentUserId");

Then do timestamp sorting at client end.

Post a Comment for "How Do I Set Double Query Of Firebase Realtime Database?"