Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 0b3ed3b

Browse files
author
Dekel Barzilay
committed
Added support for ref in $select & $sort
1 parent dd854e1 commit 0b3ed3b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ operators are:
127127
'$ilike',
128128
'$notILike',
129129
'$or',
130-
'$and'
130+
'$and',
131+
'$sort'
131132
```
132133

133134
### Eager Queries
@@ -178,8 +179,12 @@ Note that all this eager related options are optional.
178179
- **`$mergeEager`** - merge an eager expression to `$eager`,
179180
e.g. `companies.find({ query: { $eager: 'employees', $mergeEager: 'ceos' } })`
180181

181-
- **`$select`** - add SELECT statement with given array of column names. See
182-
[`$select`](https://vincit.github.io/objection.js/api/query-builder/find-methods.html#select) documentation.
182+
- **`$select`** - add SELECT statement with given array of column names, e.g. `['name', 'ref(jsonb:a)', 'ref(jsonb:a) as a']`. See
183+
[`select`](https://vincit.github.io/objection.js/api/query-builder/find-methods.html#select)
184+
and [`FieldExpression`](https://vincit.github.io/objection.js/api/types/#type-fieldexpression) documentation.
185+
186+
- **`$sort`** - add an order by clause to the query, e.g. `query: { $sort: { a: 1, 'b.c': -1, 'ref(jsonb:a)': 1 } }`. See
187+
[`FieldExpression`](https://vincit.github.io/objection.js/api/types/#type-fieldexpression) documentation.
183188

184189
- **`$noSelect`** - skips SELECT queries in create, patch & remove requests. response data will be based on the input data.
185190

0 commit comments

Comments
 (0)