Skip to content

Commit dffb2c2

Browse files
committed
improved docstrings
1 parent 35511b2 commit dffb2c2

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

packages/google-cloud-firestore/google/cloud/firestore_v1/pipeline_expressions.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -613,15 +613,19 @@ def less_than_or_equal(
613613
def between(
614614
self, lower: Expression | CONSTANT_TYPE, upper: Expression | CONSTANT_TYPE
615615
) -> "BooleanExpression":
616-
"""Creates an expression that checks if this expression is between two values.
616+
"""Evaluates if the result of this expression is between
617+
the lower bound (inclusive) and upper bound (inclusive).
618+
619+
This is functionally equivalent to performing an `And` operation with
620+
`greater_than_or_equal` and `less_than_or_equal`.
617621
618622
Example:
619623
>>> # Check if the 'age' field is between 18 and 65
620624
>>> Field.of("age").between(18, 65)
621625
622626
Args:
623-
lower: The lower bound expression or constant value.
624-
upper: The upper bound expression or constant value.
627+
lower: Lower bound (inclusive) of the range.
628+
upper: Upper bound (inclusive) of the range.
625629
626630
Returns:
627631
A new `BooleanExpression` representing the between comparison.
@@ -633,14 +637,17 @@ def between(
633637

634638
@expose_as_static
635639
def geo_distance(self, other: Expression | CONSTANT_TYPE) -> "FunctionExpression":
636-
"""Creates an expression that calculates the distance between two geographical points.
640+
"""Evaluates to the distance in meters between the location in the specified
641+
field and the query location.
642+
643+
Note: This Expression can only be used within a `Search` stage.
637644
638645
Example:
639646
>>> # Calculate distance between the 'location' field and a target GeoPoint
640647
>>> Field.of("location").geo_distance(target_point)
641648
642649
Args:
643-
other: The other point expression or constant value.
650+
other: Compute distance to this GeoPoint expression or constant value.
644651
645652
Returns:
646653
A new `FunctionExpression` representing the distance.
@@ -2678,6 +2685,8 @@ def __init__(self):
26782685

26792686
class DocumentMatches(BooleanExpression):
26802687
"""Creates a boolean expression for a document match query.
2688+
2689+
Note: This Expression can only be used within a `Search` stage.
26812690
26822691
Example:
26832692
>>> # Find documents matching the query string

0 commit comments

Comments
 (0)