OrderLen returns a custom predicate function (as defined in the doc), that sets the result order by the length of the given JSON value.
(column string, opts ...Option)
| 350 | // OrderLen returns a custom predicate function (as defined in the doc), |
| 351 | // that sets the result order by the length of the given JSON value. |
| 352 | func OrderLen(column string, opts ...Option) func(*sql.Selector) { |
| 353 | return func(s *sql.Selector) { |
| 354 | s.OrderExpr(LenPath(column, opts...)) |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | // OrderLenDesc returns a custom predicate function (as defined in the doc), that |
| 359 | // sets the result order by the length of the given JSON value, but in descending order. |