【发布时间】:2021-03-01 00:34:35
【问题描述】:
我在尝试使用查询从 Firestore 数据库中检索文档时收到以下错误。错误是:Uncaught FirebaseError: Function Query.get() requires its first argument to be of type object,但它是:一个数组。
正如我所料,它会返回一组文档(根据 Google 文档),我对消息感到困惑?谁能告诉我哪里出错了?
if (email) {
var db = firebase.firestore();
db.collection("guarantees").where("customer.email", "==", email)
.get().then((snap) => {
let doc = snap.docs[0];
//....
【问题讨论】:
标签: javascript firebase google-cloud-firestore