Skip to content

Commit addbcbf

Browse files
committed
add type and constant functions
1 parent 79e3d2b commit addbcbf

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

snippets/firestore/firestore_pipelines.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,24 @@
2121

2222
# pylint: disable=invalid-name
2323

24+
def type_generic_functions():
25+
from google.cloud.firestore_v1.pipeline_expressions import Field, Constant
26+
# [START type_function]
27+
Field.of("rating").type()
28+
# [END type_function]
29+
30+
# [START concat_function]
31+
Constant.of("Author ID: ").concat(Field.of("authorId"))
32+
# [END concat_function]
33+
34+
# [START length_function]
35+
Field.of("tags").length()
36+
# [END length_function]
37+
38+
# [START reverse_function]
39+
Field.of("tags").reverse()
40+
# [END reverse_function]
41+
2442
def query_explain():
2543
# [START query_explain]
2644
from google.cloud.firestore import Query, FieldFilter

0 commit comments

Comments
 (0)