multi query and pagination with firestore

后端 未结 4 952
自闭症患者
自闭症患者 2021-01-02 11:31

I am trying to implement multi query and pagination with firestore, but once I add < or > to the query the cursor not working.



        
4条回答
  •  Happy的楠姐
    2021-01-02 11:58

    A Firestore query can only have a single range condition.

    From the documentation on queries:

    You can combine where() filters with orderBy() and limit().

    However, if you have a filter with a range comparison (<, <=, >, >=), your first ordering must be on the same field:

    Invalid: Range filter and first orderBy on different fields

    citiesRef.where("population", ">", 100000).orderBy("country")
    

提交回复
热议问题