简体   繁体   English

geofirestore是否会检索所有文档?

[英]Does geofirestore retrieves all documents?

I have users collection in Firestore each document of which has the format { d: <obj>, g: <str: geohash>, l: <GeoPoint> } , and I use geofirestore-js on my client app to perform a Nearby Search, and it's been working great. 我在Firestore中有一个users集合,每个文档的格式为{ d: <obj>, g: <str: geohash>, l: <GeoPoint> } ,我在客户端应用程序上使用geofirestore-js来执行附近搜索,而且效果很好。
However, I wonder if geofirestore-js retrieves all the documents from users beforehand behind the scenes, and performs the calculation to narrow down the result. 但是,我不知道geofirestore-js是否在幕后预先从users 那里检索了所有文档,并执行计算以缩小结果范围。
The reason I'm asking is that, according to Firebase official document , it is NOT the number of API calls, but number of documents which counts. 我要问的原因是,根据Firebase官方文档 ,不是API调用的数量,而是文档数量。 Or, does the library magically narrow down the result on the server side? 或者,该库是否神奇地缩小了服务器端的结果?

It does not read all the documents. 它不会阅读所有文档。 That wouldn't scale at all. 那根本无法扩展。 Geo queries use a special encoding that can be efficiently queried to find only the documents that match. 地理查询使用一种特殊的编码,可以有效地查询该编码以仅查找匹配的文档。

It even says on the GitHub page : 它甚至在GitHub页面上说:

GeoFirestore selectively loads only the data near certain locations, keeping your applications light and responsive, even with extremely large datasets. GeoFirestore仅在特定位置附近有选择地加载数据,即使您的数据集非常大,也可以保持应用程序的轻便和响应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM