parvesh
parvesh

Reputation: 458

android - Firestore get item position in order by query

In firebase we can get by order as

citiesRef.orderBy("state").orderBy("population", Direction.DESCENDING);

I am wondering, Is it possible to get item position in ordered list without actual downloading whole data

Ex: If I asks what is the position of Las Vegas if ordered by population

Upvotes: 2

Views: 876

Answers (1)

Sreekant Shenoy
Sreekant Shenoy

Reputation: 1618

Unfortunately, Firebase doesn't allow you to do that from the server. You have to do it from your coding side, which means you need to download the whole data and sort it.

Documentation can be seen here

Upvotes: 1

Related Questions