OrderValueDesc returns a custom predicate function (as defined in the doc), that sets the result order by the given JSON value, but in descending order.
(column string, opts ...Option)
| 494 | // OrderValueDesc returns a custom predicate function (as defined in the doc), |
| 495 | // that sets the result order by the given JSON value, but in descending order. |
| 496 | func OrderValueDesc(column string, opts ...Option) func(*sql.Selector) { |
| 497 | return func(s *sql.Selector) { |
| 498 | s.OrderExpr( |
| 499 | sql.DescExpr(ValuePath(column, opts...)), |
| 500 | ) |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | // valuePath writes to the given SQL builder the JSON path for |
| 505 | // getting the value of a given JSON path. |