Skip to content

Manager API: orderBy expression #3425

Closed Answered by dickermoshe
Romain-Guillot asked this question in Q&A
Discussion options

You must be logged in to vote

The manager API was kept very simple, maybe too simple.

However, you can do what your describing using a computed field.

// First create an computed field with an expression you want to use
final lowerCaseName = db.managers.todos.computedField((o) => o.name.lower());
// Then use it
db.managers.todos.withFields([lowerCaseName]).orderBy((_) => lowerCaseName.orderings.asc())

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dickermoshe
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants