Skip to content
Advertisement

How do I order my database results from Firestore?

I am making an app that tracks the number of users’ tardiness using Firestore, but I can’t figure out how to order the list of results by number of tardy.

I’ve tried using the orderBy() function from Firebase docs, but I haven’t been able to implement it correctly with my existing code yet.

JavaScript

Advertisement

Answer

From reading the documentation on ordering data, something like this should do the trick:

JavaScript
Advertisement