MCPcopy
hub / github.com/ent/ent / OrderLenDesc

Function OrderLenDesc

dialect/sql/sqljson/sqljson.go:360–366  ·  view source on GitHub ↗

OrderLenDesc returns a custom predicate function (as defined in the doc), that sets the result order by the length of the given JSON value, but in descending order.

(column string, opts ...Option)

Source from the content-addressed store, hash-verified

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.
360func OrderLenDesc(column string, opts ...Option) func(*sql.Selector) {
361 return func(s *sql.Selector) {
362 s.OrderExpr(
363 sql.DescExpr(LenPath(column, opts...)),
364 )
365 }
366}
367
368// LenPath writes to the given SQL builder the JSON path for
369// getting the length of a given JSON path.

Callers 1

OrderFunction · 0.92

Calls 3

DescExprFunction · 0.92
LenPathFunction · 0.85
OrderExprMethod · 0.45

Tested by 1

OrderFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…