Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
733 views
in Technique[技术] by (71.8m points)

firebase - Firestore order by two fields

In firestore I'm wondering if there is a way to have a hueristic1 and get all data between two hueristic1 values but order the results based on a hueristic2.

I ask because the data at bottom of both pages

https://firebase.google.com/docs/firestore/query-data/order-limit-data

https://firebase.google.com/docs/firestore/query-data/query-cursors

there seems to be slightly contradictory documentation.

What I want to be able to do is

Ref.startAt(some h1 value).endAt(some second h1 value).orderBy(h2).  

I know I'd probably have to index by h1 but even then I'm not sure if there is a way to do this.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...