@@ -396,7 +396,7 @@ def sqrt(self) -> "Expression":
396396 return Function ("sqrt" , [self ])
397397
398398 @expose_as_static
399- def logical_maximum (self , other : Expression | CONSTANT_TYPE ) -> "Expression" :
399+ def logical_maximum (self , * others : Expression | CONSTANT_TYPE ) -> "Expression" :
400400 """Creates an expression that returns the larger value between this expression
401401 and another expression or constant, based on Firestore's value type ordering.
402402
@@ -406,23 +406,23 @@ def logical_maximum(self, other: Expression | CONSTANT_TYPE) -> "Expression":
406406 Example:
407407 >>> # Returns the larger value between the 'discount' field and the 'cap' field.
408408 >>> Field.of("discount").logical_maximum(Field.of("cap"))
409- >>> # Returns the larger value between the 'value' field and 10.
410- >>> Field.of("value").logical_maximum(10)
409+ >>> # Returns the larger value between the 'value' field and some ints
410+ >>> Field.of("value").logical_maximum(10, 20, 30 )
411411
412412 Args:
413- other : The other expression or constant value to compare with.
413+ others : The other expression or constant values to compare with.
414414
415415 Returns:
416416 A new `Expression` representing the logical maximum operation.
417417 """
418418 return Function (
419419 "maximum" ,
420- [self , self ._cast_to_expr_or_convert_to_constant (other ) ],
420+ [self ] + [ self ._cast_to_expr_or_convert_to_constant (o ) for o in others ],
421421 infix_name_override = "logical_maximum" ,
422422 )
423423
424424 @expose_as_static
425- def logical_minimum (self , other : Expression | CONSTANT_TYPE ) -> "Expression" :
425+ def logical_minimum (self , * others : Expression | CONSTANT_TYPE ) -> "Expression" :
426426 """Creates an expression that returns the smaller value between this expression
427427 and another expression or constant, based on Firestore's value type ordering.
428428
@@ -432,18 +432,18 @@ def logical_minimum(self, other: Expression | CONSTANT_TYPE) -> "Expression":
432432 Example:
433433 >>> # Returns the smaller value between the 'discount' field and the 'floor' field.
434434 >>> Field.of("discount").logical_minimum(Field.of("floor"))
435- >>> # Returns the smaller value between the 'value' field and 10.
436- >>> Field.of("value").logical_minimum(10)
435+ >>> # Returns the smaller value between the 'value' field and some ints
436+ >>> Field.of("value").logical_minimum(10, 20, 30 )
437437
438438 Args:
439- other : The other expression or constant value to compare with.
439+ others : The other expression or constant values to compare with.
440440
441441 Returns:
442442 A new `Expression` representing the logical minimum operation.
443443 """
444444 return Function (
445445 "minimum" ,
446- [self , self ._cast_to_expr_or_convert_to_constant (other ) ],
446+ [self ] + [ self ._cast_to_expr_or_convert_to_constant (o ) for o in others ],
447447 infix_name_override = "logical_minimum" ,
448448 )
449449
@@ -629,6 +629,25 @@ def not_equal_any(
629629 ],
630630 )
631631
632+ @expose_as_static
633+ def array_get (self , offset : Expression | int ) -> "Function" :
634+ """
635+ Creates an expression that indexes into an array from the beginning or end and returns the
636+ element. A negative offset starts from the end.
637+
638+ Example:
639+ >>> Array([1,2,3]).array_get(0)
640+
641+ Args:
642+ offset: the index of the element to return
643+
644+ Returns:
645+ A new `Expression` representing the `array_get` operation.
646+ """
647+ return Function (
648+ "array_get" , [self , self ._cast_to_expr_or_convert_to_constant (offset )]
649+ )
650+
632651 @expose_as_static
633652 def array_contains (
634653 self , element : Expression | CONSTANT_TYPE
0 commit comments