go - 在Firestore中找不到docRef.Get(ctx)的读取成本是多少?

标签 go google-cloud-firestore

A,B和C点的读取成本是多少?是否始终是1读,或者在任何情况下都不会发生读?

dsnap, err := docRef.Get(ctx)
if status.Code(err) == codes.NotFound {
    return nil, ErrNotFound // Point A
}
if err != nil {
    return nil, err // Point B
}

// Point C

最佳答案

根据documentation on pricing:

查询的最低费用

您每次查询至少要读取一份文档
执行,即使查询没有返回结果。

这表明,每次调用Get时,如果请求到达服务器,则将花费1读取。这实质上是使用可大规模扩展的Firestore索引的成本。

关于go - 在Firestore中找不到docRef.Get(ctx)的读取成本是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61641099/

相关文章:

google-app-engine - 从 AppEngine 使用 Firebase Admin SDK for Go

ios - 为什么打印语句没有按正确的顺序执行??我疯了还是Xcode?

javascript - Firestore 使用数据库/服务器时间进行查询

google-app-engine - go get 失败,返回 "no buildable Go source files found in github.com/..."

go - 在 gorp 中使用 Select 的问题

regex - golang regexp查找匹配的字符串

go - 读取 RPi 的 GPIO 上的温度传感器值。脚步

android - 有没有办法让每个人都可以访问 firestore 数据库,但只能通过应用程序访问?

java - WorkManager 一次执行 enqueueUniquePeriodicWork() 多次?

firebase - 火存储 : What is the best way to populate array of ids with its content?