node.js - Firebase 管理员查询:collection where documentId() IN Array of ids
问题描述
此查询适用于 Web Firebase SDK:
firestore.collection("recipes").where(firebase.firestore.FieldValue.documentId(), 'in', ['recipe12','recipe17']).get()
但是在我的带有“firebase-admin”的云功能中,我收到了这个错误:
错误:firebase.firestore.FieldValue.documentId() 的对应值必须是字符串或 DocumentReference。
解决方案
它firebase.firestore.FieldPath.documentId()
在 Web 和 Admin SDK 中都有。
网站:https ://firebase.google.com/docs/reference/js/firebase.firestore.FieldPath.html#documentid
阿迪明:https ://googleapis.dev/nodejs/firestore/latest/FieldPath.html#.documentId
FieldValue.documentId()
应该是undefined
。
推荐阅读
- uml - UML 中关联的主题/语义标记
- yii - Yii2 data-* 属性未使用 GridView 列呈现
- python - 没有名为 pandas 的模块,但 pandas 已安装在 linux 中
- mysql - MySql 查询以获取具有子查询值之一的列的行
- javascript - Redux 形式的异步数据加载
- javascript - 图片脚本不显示
- amazon-web-services - AWS 在流式视频问题中识别人脸
- vim - 系统升级到ubuntu18.04后无法使用vim
- wordpress - WordPress 搜索上的慢查询
- reactjs - React.js 值未在按钮上更新