querier-ts 2.7.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +18 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v2.7.1
|
|
4
|
+
|
|
5
|
+
### Summary
|
|
6
|
+
|
|
7
|
+
- [x] Documentation updates
|
|
8
|
+
- [ ] Bug fixes
|
|
9
|
+
- [ ] Code refactoring
|
|
10
|
+
- [ ] New features
|
|
11
|
+
- [ ] Breaking changes
|
|
12
|
+
|
|
13
|
+
### New features
|
|
14
|
+
|
|
15
|
+
- Update `README.md` documentation for `orderBy()` method with new overload and examples.
|
|
16
|
+
|
|
3
17
|
## v2.7.0
|
|
4
18
|
|
|
5
19
|
### Summary
|
package/README.md
CHANGED
|
@@ -144,23 +144,30 @@ const query = Query.from()
|
|
|
144
144
|
|
|
145
145
|
### Ordering results
|
|
146
146
|
|
|
147
|
-
#### `orderBy(...columns)`
|
|
147
|
+
#### `orderBy(...columns | (callback, order?))`
|
|
148
148
|
|
|
149
|
-
Sorts the results.
|
|
149
|
+
Sorts the results.
|
|
150
150
|
|
|
151
|
-
|
|
152
|
-
.
|
|
153
|
-
|
|
151
|
+
- `columns`: the columns to order by.
|
|
152
|
+
- `callback`: A function that maps each row to a value.
|
|
153
|
+
- `order`: The order to sort in.
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
You can specify column names or a callback function to map each row to a value.
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
Examples:
|
|
158
158
|
|
|
159
159
|
```ts
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
// Column names with ASC and DESC (-) order
|
|
161
|
+
.orderBy('name', '-createdAt')
|
|
162
|
+
|
|
163
|
+
// callback with ASC order by default
|
|
164
|
+
.orderBy((user) => user.address.country)
|
|
165
|
+
|
|
166
|
+
// callback with ASC order set explicitly
|
|
167
|
+
.orderBy((user) => user.address.country, 'asc')
|
|
168
|
+
|
|
169
|
+
// callback with DESC order
|
|
170
|
+
.orderBy((user) => user.address.country, 'desc')
|
|
164
171
|
```
|
|
165
172
|
|
|
166
173
|
---
|