MCPcopy
hub / github.com/redis/redis-py / apply

Method apply

redis/commands/search/aggregation.py:162–178  ·  view source on GitHub ↗

Specify one or more projection expressions to add to each result ### Parameters - **kwexpr**: One or more key-value pairs for a projection. The key is the alias for the projection, and the value is the projection expression itself, for example `appl

(self, **kwexpr)

Source from the content-addressed store, hash-verified

160 return self
161
162 def apply(self, **kwexpr) -> "AggregateRequest":
163 """
164 Specify one or more projection expressions to add to each result
165
166 ### Parameters
167
168 - **kwexpr**: One or more key-value pairs for a projection. The key is
169 the alias for the projection, and the value is the projection
170 expression itself, for example `apply(square_root="sqrt(@foo)")`
171 """
172 for alias, expr in kwexpr.items():
173 ret = ["APPLY", expr]
174 if alias is not None:
175 ret += ["AS", alias]
176 self._aggregateplan.extend(ret)
177
178 return self
179
180 def limit(self, offset: int, num: int) -> "AggregateRequest":
181 """

Callers 7

create_query_tableFunction · 0.45
query_agg.pyFile · 0.45
test_profileMethod · 0.45

Calls 1

extendMethod · 0.45