glide_shared.commands.sorted_set
InfBound
Bases: Enum
Enumeration representing numeric and lexicographic positive and negative infinity bounds for sorted set.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
POS_INF = {'score_arg': '+inf', 'lex_arg': '+'}
class-attribute
instance-attribute
Positive infinity bound for sorted set.
score_arg: represents numeric positive infinity (+inf).
lex_arg: represents lexicographic positive infinity (+).
NEG_INF = {'score_arg': '-inf', 'lex_arg': '-'}
class-attribute
instance-attribute
Negative infinity bound for sorted set.
score_arg: represents numeric negative infinity (-inf).
lex_arg: represents lexicographic negative infinity (-).
AggregationType
Bases: Enum
Enumeration representing aggregation types for ZINTERSTORE and ZUNIONSTORE sorted set commands.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
SUM = 'SUM'
class-attribute
instance-attribute
Represents aggregation by summing the scores of elements across inputs where they exist.
MIN = 'MIN'
class-attribute
instance-attribute
Represents aggregation by selecting the minimum score of an element across inputs where it exists.
MAX = 'MAX'
class-attribute
instance-attribute
Represents aggregation by selecting the maximum score of an element across inputs where it exists.
ScoreFilter
Bases: Enum
Defines which elements to pop from a sorted set.
ScoreFilter is a mandatory option for ZMPOP and BZMPOP.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
MIN = 'MIN'
class-attribute
instance-attribute
Pop elements with the lowest scores.
MAX = 'MAX'
class-attribute
instance-attribute
Pop elements with the highest scores.
ScoreBoundary
Represents a specific numeric score boundary in a sorted set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
float
|
The score value. |
required |
is_inclusive
|
bool
|
Whether the score value is inclusive. Defaults to True. |
True
|
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
70 71 72 73 74 75 76 77 78 79 80 81 | |
LexBoundary
Represents a specific lexicographic boundary in a sorted set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
The lex value. |
required |
is_inclusive
|
bool
|
Whether the score value is inclusive. Defaults to True. |
True
|
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
84 85 86 87 88 89 90 91 92 93 94 95 | |
RangeByIndex
Represents a range by index (rank) in a sorted set.
The start and end arguments represent zero-based indexes.
Attributes:
| Name | Type | Description |
|---|---|---|
start |
int
|
The start index of the range. |
end |
int
|
The end index of the range. |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
RangeByScore
Represents a range by score in a sorted set.
The start and end arguments represent score boundaries.
Attributes:
| Name | Type | Description |
|---|---|---|
start |
Union[InfBound, ScoreBoundary]
|
The start score boundary. |
end |
Union[InfBound, ScoreBoundary]
|
The end score boundary. |
limit |
Optional[Limit]
|
The limit argument for a range query. Defaults to None. See |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
RangeByLex
Represents a range by lexicographical order in a sorted set.
The start and end arguments represent lexicographical boundaries.
Attributes:
| Name | Type | Description |
|---|---|---|
start |
Union[InfBound, LexBoundary]
|
The start lexicographic boundary. |
end |
Union[InfBound, LexBoundary]
|
The end lexicographic boundary. |
limit |
Optional[Limit]
|
The limit argument for a range query. Defaults to None. See |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
GeospatialData
Represents a geographic position defined by longitude and latitude.
The exact limits, as specified by EPSG:900913 / EPSG:3785 / OSGEO:41001 are the following:
- Valid longitudes are from -180 to 180 degrees.
- Valid latitudes are from -85.05112878 to 85.05112878 degrees.
Attributes:
| Name | Type | Description |
|---|---|---|
longitude |
float
|
The longitude coordinate. |
latitude |
float
|
The latitude coordinate. |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
GeoUnit
Bases: Enum
Enumeration representing distance units options for the GEODIST command.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | |
METERS = 'm'
class-attribute
instance-attribute
Represents distance in meters.
KILOMETERS = 'km'
class-attribute
instance-attribute
Represents distance in kilometers.
MILES = 'mi'
class-attribute
instance-attribute
Represents distance in miles.
FEET = 'ft'
class-attribute
instance-attribute
Represents distance in feet.
GeoSearchByRadius
Represents search criteria of searching within a certain radius from a specified point.
Attributes:
| Name | Type | Description |
|---|---|---|
radius |
float
|
Radius of the search area. |
unit |
GeoUnit
|
Unit of the radius. See |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | |
to_args()
Convert the search criteria to the corresponding part of the command.
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: List representation of the search criteria. |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
224 225 226 227 228 229 230 231 | |
GeoSearchByBox
Represents search criteria of searching within a specified rectangular area.
Attributes:
| Name | Type | Description |
|---|---|---|
width |
float
|
Width of the bounding box. |
height |
float
|
Height of the bounding box |
unit |
GeoUnit
|
Unit of the radius. See |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
to_args()
Convert the search criteria to the corresponding part of the command.
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: List representation of the search criteria. |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
252 253 254 255 256 257 258 259 | |
GeoSearchCount
Represents the count option for limiting the number of results in a GeoSearch.
Attributes:
| Name | Type | Description |
|---|---|---|
count |
int
|
The maximum number of results to return. |
any_option |
bool
|
Whether to allow returning as enough matches are found. This means that the results returned may not be the ones closest to the specified point. Default to False. |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | |
to_args()
Convert the count option to the corresponding part of the command.
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: List representation of the count option. |
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
279 280 281 282 283 284 285 286 287 288 | |
separate_keys(keys)
Returns separate lists of keys and weights in case of weighted keys.
Source code in doc-gen/valkey-glide/python/glide-shared/glide_shared/commands/sorted_set.py
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | |