2
created_at列でEctoクエリを注文すると、次のコードが正常に動作します。私は情報と呼ばれるタイプjsonbのデータベース列があり、JSONオブジェクト内のフィールドの一つが、「ステータス」で、そのフィールドでソートする方法があると仮定すると、Ectoクエリ - jsonb列のorder_byフィールド
sort_params = [asc: :created_at]
query = from user in users,
order_by: ^sort_params,
limit: ^page_size,
offset: ^offset
? んエクトは
sort_params = [asc: :info.status]