Firestore:如何使用不等式/不等于执行查询我想从Firestore集合中选择仅由我编写的文章。 这真的很难吗?每篇文章都有字段“owner_uid”。多数民众赞成:我只想写相当于"select * from articles where uid<>request.auth.uid"
3 回答
www说
TA贡献1775条经验 获得超8个赞
对于android,应该很容易使用Task Api实现。新手的例子:
FirebaseFirestore db = FirebaseFirestore.getInstance(); Query lessQuery = db.collection("users").whereLessThan("uid", currentUid); Query greaterQuery = db.collection("users").whereGreaterThan("uid", currentUid); Task lessQuery Task = firstQuery.get(); Task greaterQuery = secondQuery.get(); Task combinedTask = Tasks.whenAllSuccess(lessQuery , greaterQuery) .addOnSuccessListener(new OnSuccessListener<List<Object>>() { @Override public void onSuccess(List<Object> list) { //This is the list of "users" collection without user with currentUid } });
此外,通过它,您可以组合任何一组查询。
对于网络有rxfire
添加回答
举报
0/150
提交
取消