What will be the Indexing and query for this in Firebase real-time Database?
Asked
Active
Viewed 46 times
0

Mark Rotteveel
- 100,966
- 191
- 140
- 197
-
1Can you show us what you have tried? – Tarik Huber Aug 29 '21 at 11:22
-
I haven't tried anything, I want to see how can we write query for this? – IrfanBaitham Aug 29 '21 at 11:38
1 Answers
1
This would be a way to sort and query on that params:
var ref = firebase
.database()
.ref("indraday/2021-08-29")
.orderByChild("AAMRANET/cp")
.startAt("0.00");
ref.once("value", (snap) => {
snap.forEach((childSnap) => {
var childKey = childSnap.key;
var childData = childSnap.val();
console.log(childData);
});
});
Do consider that you save the value as String
and not as number. That means it will be sorted as if it is a String
and not a number.

Tarik Huber
- 7,061
- 2
- 12
- 18