@@ -1309,9 +1309,9 @@ def add_from_alias_to_where_tokens(self, from_alias: str) -> None:
13091309 raise RuntimeError ("Alias cannot be None or empty" )
13101310
13111311 tokens = self .__get_current_where_tokens ()
1312- for token in tokens :
1312+ for i , token in enumerate ( tokens ) :
13131313 if isinstance (token , WhereToken ):
1314- token .add_alias (from_alias )
1314+ tokens [ i ] = token .add_alias (from_alias )
13151315
13161316 def add_alias_to_includes_tokens (self , from_alias : str ) -> str :
13171317 if self ._includes_alias is None :
@@ -2757,6 +2757,175 @@ def suggest_using(
27572757 self ._suggest_using (suggestion_or_builder )
27582758 return SuggestionDocumentQuery (self )
27592759
2760+ # Date-component filter methods. The C# client achieves the same result via LINQ expression
2761+ # trees (e.g. Where(x => x.Date.Year == 2024)), which the LINQ provider translates to the
2762+ # property-access form "Date.Year = $p0" in RQL. Python has no expression-tree mechanism,
2763+ # so these methods construct the same dot-notation path directly. "exact" is intentionally
2764+ # omitted: date components are always integers, so case/token options have no effect.
2765+ #
2766+ # where_ticks accepts a raw .NET tick count (100-nanosecond intervals since 0001-01-01).
2767+
2768+ def where_year (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2769+ return self .where_equals (f"{ field_name } .Year" , value )
2770+
2771+ def where_year_greater_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2772+ self ._where_greater_than (f"{ field_name } .Year" , value )
2773+ return self
2774+
2775+ def where_year_greater_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2776+ self ._where_greater_than_or_equal (f"{ field_name } .Year" , value )
2777+ return self
2778+
2779+ def where_year_less_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2780+ self ._where_less_than (f"{ field_name } .Year" , value )
2781+ return self
2782+
2783+ def where_year_less_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2784+ self ._where_less_than_or_equal (f"{ field_name } .Year" , value )
2785+ return self
2786+
2787+ def where_year_between (self , field_name : str , start : int , end : int ) -> "DocumentQuery[_T]" :
2788+ self ._where_between (f"{ field_name } .Year" , start , end )
2789+ return self
2790+
2791+ def where_month (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2792+ return self .where_equals (f"{ field_name } .Month" , value )
2793+
2794+ def where_month_greater_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2795+ self ._where_greater_than (f"{ field_name } .Month" , value )
2796+ return self
2797+
2798+ def where_month_greater_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2799+ self ._where_greater_than_or_equal (f"{ field_name } .Month" , value )
2800+ return self
2801+
2802+ def where_month_less_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2803+ self ._where_less_than (f"{ field_name } .Month" , value )
2804+ return self
2805+
2806+ def where_month_less_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2807+ self ._where_less_than_or_equal (f"{ field_name } .Month" , value )
2808+ return self
2809+
2810+ def where_month_between (self , field_name : str , start : int , end : int ) -> "DocumentQuery[_T]" :
2811+ self ._where_between (f"{ field_name } .Month" , start , end )
2812+ return self
2813+
2814+ def where_day_of_month (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2815+ return self .where_equals (f"{ field_name } .Day" , value )
2816+
2817+ def where_day_of_month_greater_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2818+ self ._where_greater_than (f"{ field_name } .Day" , value )
2819+ return self
2820+
2821+ def where_day_of_month_greater_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2822+ self ._where_greater_than_or_equal (f"{ field_name } .Day" , value )
2823+ return self
2824+
2825+ def where_day_of_month_less_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2826+ self ._where_less_than (f"{ field_name } .Day" , value )
2827+ return self
2828+
2829+ def where_day_of_month_less_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2830+ self ._where_less_than_or_equal (f"{ field_name } .Day" , value )
2831+ return self
2832+
2833+ def where_day_of_month_between (self , field_name : str , start : int , end : int ) -> "DocumentQuery[_T]" :
2834+ self ._where_between (f"{ field_name } .Day" , start , end )
2835+ return self
2836+
2837+ def where_hour (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2838+ return self .where_equals (f"{ field_name } .Hour" , value )
2839+
2840+ def where_hour_greater_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2841+ self ._where_greater_than (f"{ field_name } .Hour" , value )
2842+ return self
2843+
2844+ def where_hour_greater_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2845+ self ._where_greater_than_or_equal (f"{ field_name } .Hour" , value )
2846+ return self
2847+
2848+ def where_hour_less_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2849+ self ._where_less_than (f"{ field_name } .Hour" , value )
2850+ return self
2851+
2852+ def where_hour_less_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2853+ self ._where_less_than_or_equal (f"{ field_name } .Hour" , value )
2854+ return self
2855+
2856+ def where_hour_between (self , field_name : str , start : int , end : int ) -> "DocumentQuery[_T]" :
2857+ self ._where_between (f"{ field_name } .Hour" , start , end )
2858+ return self
2859+
2860+ def where_minute (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2861+ return self .where_equals (f"{ field_name } .Minute" , value )
2862+
2863+ def where_minute_greater_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2864+ self ._where_greater_than (f"{ field_name } .Minute" , value )
2865+ return self
2866+
2867+ def where_minute_greater_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2868+ self ._where_greater_than_or_equal (f"{ field_name } .Minute" , value )
2869+ return self
2870+
2871+ def where_minute_less_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2872+ self ._where_less_than (f"{ field_name } .Minute" , value )
2873+ return self
2874+
2875+ def where_minute_less_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2876+ self ._where_less_than_or_equal (f"{ field_name } .Minute" , value )
2877+ return self
2878+
2879+ def where_minute_between (self , field_name : str , start : int , end : int ) -> "DocumentQuery[_T]" :
2880+ self ._where_between (f"{ field_name } .Minute" , start , end )
2881+ return self
2882+
2883+ def where_second (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2884+ return self .where_equals (f"{ field_name } .Second" , value )
2885+
2886+ def where_second_greater_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2887+ self ._where_greater_than (f"{ field_name } .Second" , value )
2888+ return self
2889+
2890+ def where_second_greater_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2891+ self ._where_greater_than_or_equal (f"{ field_name } .Second" , value )
2892+ return self
2893+
2894+ def where_second_less_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2895+ self ._where_less_than (f"{ field_name } .Second" , value )
2896+ return self
2897+
2898+ def where_second_less_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2899+ self ._where_less_than_or_equal (f"{ field_name } .Second" , value )
2900+ return self
2901+
2902+ def where_second_between (self , field_name : str , start : int , end : int ) -> "DocumentQuery[_T]" :
2903+ self ._where_between (f"{ field_name } .Second" , start , end )
2904+ return self
2905+
2906+ def where_ticks (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2907+ return self .where_equals (f"{ field_name } .Ticks" , value )
2908+
2909+ def where_ticks_greater_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2910+ self ._where_greater_than (f"{ field_name } .Ticks" , value )
2911+ return self
2912+
2913+ def where_ticks_greater_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2914+ self ._where_greater_than_or_equal (f"{ field_name } .Ticks" , value )
2915+ return self
2916+
2917+ def where_ticks_less_than (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2918+ self ._where_less_than (f"{ field_name } .Ticks" , value )
2919+ return self
2920+
2921+ def where_ticks_less_than_or_equal (self , field_name : str , value : int ) -> "DocumentQuery[_T]" :
2922+ self ._where_less_than_or_equal (f"{ field_name } .Ticks" , value )
2923+ return self
2924+
2925+ def where_ticks_between (self , field_name : str , start : int , end : int ) -> "DocumentQuery[_T]" :
2926+ self ._where_between (f"{ field_name } .Ticks" , start , end )
2927+ return self
2928+
27602929
27612930class RawDocumentQuery (Generic [_T ], AbstractDocumentQuery [_T ]):
27622931 def __init__ (self , object_type : Type [_T ], session : InMemoryDocumentSessionOperations , raw_query : str ):
0 commit comments