【发布时间】:2020-07-13 23:14:31
【问题描述】:
这是我第一次使用 StackOverflow。希望有人能帮帮我!
我正在尝试编写 React-redux 应用程序,目前正在尝试将 Firebase 集成到应用程序中。当我console.log一个collectionReference对象时,由于某种原因,对象名称被称为n,并且对象的键似乎是乱码,例如Ch, Hw,等...我不确定发生了什么在。有谁知道 console.log 似乎没有给我关于我的收藏对象的信息?是因为出于安全原因,数据以某种方式加密了吗?这是我为 concole.loging collectionReference 对象编写的方法。
export const addCollectionAndDocuments = (collectionKeys, objectsToAdd) => {
const collectionRef = firestore.collection(collectionKeys);
console.log(collectionRef);
};
这是我得到的回应。
n {qa: t, Hd: t, dw: t, firestore: t, Qa: null, …}
Cw: n {segments: Array(1), offset: 0, m: 1}
Hd: t {s: t, ignoreUndefinedProperties: false, serializer: Ft}
Qa: null
dw: t {path: n, collectionGroup: null, ds: Array(0), filters: Array(0), limit: null, …}
firestore: t {Bd: FirebaseAppImpl, qd: t, INTERNAL: {…}, qa: t, jd: "[DEFAULT]", …}
id: (...)
parent: (...)
path: (...)
qa: t {projectId: "shop-2b337", database: "(default)"}
__proto__: n
【问题讨论】:
-
在我看来,这确实像一个参考对象;你期待什么,为什么?
-
嗨,克里斯!我期望 console.log 会打印出具有关联键名的 CollectionReference 对象。现在,关键名称是 Cw、Ha、Qa ...,我真的不知道它们来自哪里,因为我没有设置它们。
-
我假设这些是内部属性;您是否尝试在参考上调用
.get()、.where()等?我的意思是,虽然我当然不是 Firestore 专家,但我没有看到任何表明出现问题的东西。
标签: javascript firebase google-cloud-firestore react-redux