File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -557,6 +557,19 @@ def cursor_simple_end_at():
557
557
return query_end_at
558
558
559
559
560
+ def snapshot_cursors ():
561
+ db = firestore .Client ()
562
+ # [START fs_start_at_snapshot_query_cursor]
563
+ doc_ref = db .collection (u'cities' ).document (u'SF' )
564
+
565
+ snapshot = doc_ref .get ()
566
+ start_at_snapshot = db .collection (
567
+ u'cities' ).order_by (u'population' ).start_at (snapshot )
568
+
569
+ return start_at_snapshot .limit (10 ).get ()
570
+ # [END fs_start_at_snapshot_query_cursor]
571
+
572
+
560
573
def cursor_paginate ():
561
574
db = firestore .Client ()
562
575
# [START cursor_paginate]
Original file line number Diff line number Diff line change @@ -195,6 +195,10 @@ def test_cursor_simple_end_at():
195
195
snippets .cursor_simple_end_at ()
196
196
197
197
198
+ def test_snapshot_cursors ():
199
+ snippets .snapshot_cursors ()
200
+
201
+
198
202
def test_cursor_paginate ():
199
203
snippets .cursor_paginate ()
200
204
You can’t perform that action at this time.
0 commit comments