使用游标“结束于”过滤条件查询 Firestore 集合

使用集合让一切井井有条 根据您的偏好保存内容并对其进行分类。

使用游标“结束于”过滤条件查询 Firestore 集合

深入探索

如需查看包含此代码示例的详细文档,请参阅以下内容:

代码示例

C#

Query query = citiesRef.OrderBy("Population").EndAt(1000000);

Go

query := client.Collection("cities").OrderBy("population", firestore.Asc).EndAt(1000000)

Java

Query query = cities.orderBy("population").endAt(4921000L);

Node.js

const endAtRes = await db.collection('cities')
  .orderBy('population')
  .endAt(1000000)
  .get();

PHP

$query = $citiesRef
    ->orderBy('population')
    ->endAt([1000000]);

Python

cities_ref = db.collection(u'cities')
query_end_at = cities_ref.order_by(u'population').end_at({
    u'population': 1000000
})

Ruby

query = cities_ref.order("population").end_at(1_000_000)

后续步骤

如需搜索和过滤其他 Google Cloud 产品的代码示例,请参阅 Google Cloud 示例浏览器