MCPcopy
hub / github.com/ent/ent / OrderLen

Function OrderLen

dialect/sql/sqljson/sqljson.go:352–356  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
352func 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.

Callers

nothing calls this directly

Calls 2

LenPathFunction · 0.85
OrderExprMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…