firebase - 如何在firebase中进行或
问题描述
您好,我是 firebase 的新手,搜索时遇到困难
在SQL中
select * from house where door< 2 or room=>2
在火力基地
我怎么做?
解决方案
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.
推荐阅读
- c++ - 从 CMake 中的 lib 目录加载共享库?
- mysql - 从本地机器(Ubuntu 14.04 LTS)推入 docker 时出现 mysql 问题
- javascript - Coldfusion websocket在将ws更改为wss协议时无法创建websocket握手
- c++ - 将函数指针数组中的函数指针作为模板参数传递
- sql-server - 如何将动态多个输入值传递给 SQL Server 2014 中的 LIKE 运算符?
- css - 使用 d-none d-lg-block 时引导程序无法切换
- hibernate - 执行 DDL 时出错“在 Spring Data JPA 中创建表?
- javascript - NodeJs 中的 AES/CBC/PKCS5Padding
- python - 从根文件夹导入 python 模块
- c - 常见的基于堆栈的 VM 字节码优化?