When setting a datetime Field with index=True, the field index is created as a TAG. Queries that use > or < return no data, as the query expression is evaluated to "".
This happens in both HashModel and JsonModel.
If the field is also defined with sortable=TrueAND the model is a JsonModel, the model definition raises a RedisModelError:
In this Preview release, TAG fields cannot be marked as sortable. Problem field: end_date. See docs: TODO
However if the model is a HashModel, no such exception is raised.
Possible solutions:
Store and index datetime fields as NUMERIC.
Index daetime fields as TEXT and apply parsetime to create a new query field for sorting.
redis-om-python
: 0.1.2python
: 3.10When setting a
datetime
Field withindex=True
, the field index is created as aTAG
. Queries that use>
or<
return no data, as the query expression is evaluated to""
.This happens in both
HashModel
andJsonModel
.If the field is also defined with
sortable=True
AND the model is aJsonModel
, the model definition raises aRedisModelError
:However if the model is a
HashModel
, no such exception is raised.Possible solutions:
datetime
fields asNUMERIC
.daetime
fields asTEXT
and applyparsetime
to create a new query field for sorting.