节点 Js 的新内容,期望这很容易!
在节点JS中使用Firestore,我想访问"显示名称":詹姆斯,"年龄":22
年龄没有空间,所以我可以把
const newValue = doc.data();
const age = newValue.Age;
但显示名称包含空格 你怎么打这个?
const displayName = newValue.displayName;
您需要使用[]
表示法才能访问该属性。
所以:
const displayName = newValue["display name"];