redis / redis-om-python

Object mapping, and more, for Redis and Python
MIT License
1.12k stars 112 forks source link

EmbeddedJson fields are not able to be sorted on, even with the `sortable=True` flag #431

Open sav-norem opened 1 year ago

sav-norem commented 1 year ago

Trying to do something like

result_set = Book.find( (Book.metrics.score < 3) ).sort_by("metrics.score")

will result in the error that metrics.score is not part of the model even though the find portion works as expected. Since the sort_by function requires a string to look for the - for sort order, I haven't found a way around this. Model can be found here - taken from RU 204 on JSON with OM - @simonprickett anything to add?