Skip to content

Add example in the README / docs that uses sort_by #356

Closed

Description

@simonprickett

It's possible to sort results in ASCending or DESCending order like this... ASCending:

result_set = Book.find(
    (Book.author == "Robert A. Heinlein") & (Book.year_published > 1958) & (Book.year_published < 1974)
).sort_by("year_published")

and DESCending:

result_set = Book.find(
    (Book.author == "Robert A. Heinlein") & (Book.year_published > 1958) & (Book.year_published < 1974)
).sort_by("-year_published")

but there's no documentation or example for this.

Activity

  1. abrookins commented on Jan 24, 2026

    @abrookins
    Collaborator

    Closing as completed. The sort_by functionality is now documented in the querying documentation at https://redis.github.io/redis-om-python/querying/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions