假设我正在听一个文件:
db.collection("cities").document("SF")
.addSnapshotListener { documentSnapshot, error in
guard let document = documentSnapshot else {
print("Error fetching document: \(error!)")
return
}
print("Current data: \(document.data())")
}
根据Firestore 计费政策,每次更新数据是否都算作读取操作,或者侦听行为本身是否算作?
另外,假设我正在听一些文件:
db.collection("cities").whereField("state", isEqualTo: "CA")
.addSnapshotListener { querySnapshot, error in
guard let documents = querySnapshot?.documents else {
print("Error fetching documents: \(error!)")
return
}
let cities = documents.map { $0["name"]! }
print("Current cities in CA: \(cities)")
}
是否会立即对与查询匹配的所有文档或每个文档的每次更新(或两者兼而有之)收取读取操作的费用?