What is the read cost of a not found docRef.Get(ctx) in Firestore?

一个人想着一个人 提交于 2020-05-17 06:48:26

问题


What is the read cost at point A, B and C? Is it always 1 read no matter what, or are there circumstances under which no read is incurred?

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

回答1:


According to the documentation on pricing:

Minimum charge for queries

There is a minimum charge of one document read for each query that you perform, even if the query returns no results.

This suggests that every time you call Get, it will cost 1 read if the request hits the server. This is essentially the cost of using the massively scalable Firestore indexes.



来源:https://stackoverflow.com/questions/61641099/what-is-the-read-cost-of-a-not-found-docref-getctx-in-firestore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!