在 Firebase 控制台中按数组或映射字段值查询 Firestore 文档
Querying Firestore documents by Array or Map fields values in Firebase console
在这里,我想在 Firebase 控制台中通过值 "ministoreid1" 进行查询。但我无法弄清楚。在这里,我尝试在控制台中不使用代码进行查询。
Here, I am trying to do the query in console not using codes.
遗憾的是,目前您无法根据数组中存在的值在 Firebase 控制台中过滤文档。可以看到,只有个运算符:
==
is equal to
>
is after
>=
is after and includes
<
is before
<=
is before and includes
但是whereArrayContains
选项还不存在。我建议您为此提交 feature request。它可能对其他开发人员也有用。
您在控制台中执行的查询没有 return 任何结果,因为您正在检查 mini_stores_assigned
是否等于 ministoreid1
,这显然不是因为 mini_stores_assigned
属性 是一个数组, 不是 一个字符串,因此您可以比较它们。
我已根据 Alex 的建议提交了功能请求。以及我从 Firebase 支持部门收到的回复:
Currently, there is no query similar to array-contains available in the Firestore Console. I can file a feature request ticket on your behalf. However, I can't guarantee anything at the moment, so please watch out for any updates on our blog or release notes for now. For the map field, you can try to filter on the console using the format: 'mapFieldName.keyName' in the field text box
所以我们可以通过'mapFieldName.keyName'查询地图值。我以前不知道这个。
为了将来使用,Firebase 已添加 Ssuburat 请求的功能。您现在可以根据数组中存在的值在 Firebase 控制台中过滤您的文档。
在这里,我想在 Firebase 控制台中通过值 "ministoreid1" 进行查询。但我无法弄清楚。在这里,我尝试在控制台中不使用代码进行查询。
Here, I am trying to do the query in console not using codes.
遗憾的是,目前您无法根据数组中存在的值在 Firebase 控制台中过滤文档。可以看到,只有个运算符:
==
is equal to
>
is after
>=
is after and includes
<
is before
<=
is before and includes
但是whereArrayContains
选项还不存在。我建议您为此提交 feature request。它可能对其他开发人员也有用。
您在控制台中执行的查询没有 return 任何结果,因为您正在检查 mini_stores_assigned
是否等于 ministoreid1
,这显然不是因为 mini_stores_assigned
属性 是一个数组, 不是 一个字符串,因此您可以比较它们。
我已根据 Alex 的建议提交了功能请求。以及我从 Firebase 支持部门收到的回复:
Currently, there is no query similar to array-contains available in the Firestore Console. I can file a feature request ticket on your behalf. However, I can't guarantee anything at the moment, so please watch out for any updates on our blog or release notes for now. For the map field, you can try to filter on the console using the format: 'mapFieldName.keyName' in the field text box
所以我们可以通过'mapFieldName.keyName'查询地图值。我以前不知道这个。
为了将来使用,Firebase 已添加 Ssuburat 请求的功能。您现在可以根据数组中存在的值在 Firebase 控制台中过滤您的文档。