是否可以查询firestore集合以获取以特定字符串开头的所有文档?
我已经阅读了文档,但没有找到任何合适的查询.
我正在使用适用于 android 的 Firebase Firestore 来存储数据。我试图从文档中搜索数据。
我的 Firestore 结构是:
集合(产品)- 文档(自动生成的 ID)- 字段(NumberOfPeople,OfferStartDate,OfferEndDate,OfferPrice,Location)
我为这些字段的搜索数据编写了查询。
CollectionReference collectionOfProducts = db.collection("Products);
collectionOfProducts
.whereEqualTo("Location", location)
.whereGreaterThanOrEqualTo("OfferPrice", offerPrice)
.whereLessThanOrEqualTo("OfferPrice", offerPrice)
.whereGreaterThanOrEqualTo("OfferStartDate", date)
.whereLessThanOrEqualTo("OfferEndDate", date)
.get()
Run Code Online (Sandbox Code Playgroud)
我想要这样的搜索结果:在开始日期和结束日期之间的报价,其中报价在给定价格范围内大于等于或小于等于。此查询在 android studio 中不起作用。
如何在firestore firebase中做到这一点?