【发布时间】:2019-10-13 06:19:21
【问题描述】:
从Firestore docs,我们得到Firestore 文档的最大大小 是:
文档的最大大小 1 MiB(1,048,576 字节)
问题
我如何知道单个文档的当前大小,以检查我是否正在接近 那个 1mb 的限制?
示例:
var docRef = db.collection("cities").doc("SF");
docRef.get().then(function(doc) {
if (doc.exists) {
console.log("Document data:", doc.data());
// IS THERE A PROPERTY THAT CAN DISPLAY THE DOCUMENT FILE SIZE?
} else {
// doc.data() will be undefined in this case
console.log("No such document!");
}
}).catch(function(error) {
console.log("Error getting document:", error);
});
【问题讨论】:
标签: firebase google-cloud-firestore