首页 > 解决方案 > 如何在firebase中进行或

问题描述

您好,我是 firebase 的新手,搜索时遇到困难

SQL中

  select * from house  where door< 2 or room=>2

火力基地

我怎么做?

标签: firebasefirebase-realtime-database

解决方案


You can't do this type of query with Firebase realtime database, but you can do it with Firestore.

Check this doc to know how to query your data.

// Create a reference to door collection
CollectionReference home = db.collection("home");
// Create a query against the collection.
Query query = home.whereLessThan("door", 2);

And you can do the same with rooms, but you can't use the same query to query the two things together.

For all query examples, check this.


推荐阅读