When working on my Angular Firebase project, I came across the following issue with data querying:
Data: https://i.sstatic.net/UHWut.jpg
The data is stored from oldest to newest (1 to 4).
To retrieve this data, I used the following code:
var startHere = '-KtOLj2ay8S0LHYBzQ2L'; // Start at #3
this.firedata.child('/01_Total').startAt(startHere).limitToLast(2).once('value', (snapshot) => {
var data = snapshot.val();
})
In this scenario, I was attempting to retrieve entries #1 and #2 (those after #3).
However, I encountered an uncaught promise error.
Any insights on how to resolve this?
Thank you.