Skip to content

Sort by multiple field keys failΒ #168

@sprzenus

Description

@sprzenus

What I'm trying to do is to get sorted and paginated categories:

Category.query(on: req.db)
            .sort([Category.FieldKeys.nameEN, Category.FieldKeys.namePL])
            .paginate(PageRequest(page: options.page, per: options.itemsPerPage))

The logs I get from my database:

2020-10-17 09:45:49.272 UTC [2275] LOG:  execute <unnamed>: SELECT COUNT("categories"."id") AS "aggregate" FROM "categories"
2020-10-17 09:45:49.278 UTC [2275] ERROR:  operator does not exist: text ->> unknown at character 322
2020-10-17 09:45:49.278 UTC [2275] HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.
2020-10-17 09:45:49.278 UTC [2275] STATEMENT:  SELECT "categories"."id" AS "categories_id", "categories"."name" AS "categories_name", "categories"."name_pl" AS "categories_name_pl", "categories"."is_free" AS "categories_is_free", "categories"."updated_at" AS "categories_updated_at", "categories"."created_at" AS "categories_created_at" FROM "categories" ORDER BY name->>'name_pl' ASC LIMIT 30 OFFSET 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions