Skip to content

Commit d6626a8

Browse files
committed
suggestiosn
1 parent f303549 commit d6626a8

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

docs/src/query/operators.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,25 +221,26 @@ The examples below will use the table definitions in [table tiers](../reproduce/
221221

222222
## Top
223223

224-
Similar to the univeral set operator, the top operator uses `dj.top` notation. It is used to
224+
Similar to the univeral set operator, the top operator uses `dj.Top` notation. It is used to
225225
restrict a query by the given `limit`, `order_by`, and `offset` parameters:
226226

227227
```python
228-
Session & dj.top(limit=10, order_by='session_date')
228+
Session & dj.Top(limit=10, order_by='session_date')
229229
```
230230

231231
The result of this expression returns the first 10 rows of `Session` and sorts them
232232
by their `session_date` in ascending order.
233233

234234
### `order_by`
235235

236-
| Example | Description |
237-
|-------------------------------------------|-----------------------------------------------------------------------------------|
238-
| `order_by="session_date DESC"` | Sorts by `session_date` in *descending* order |
239-
| `order_by="KEY"` | Sorts by the primary key(s) |
240-
| `order_by=["subject_id", "session_date"]` | Sorts by `subject_id`, then sorts matching `subject_id`s by their `session_date` |
236+
| Example | Description |
237+
|-------------------------------------------|---------------------------------------------------------------------------------|
238+
| `order_by="session_date DESC"` | Sort by `session_date` in *descending* order |
239+
| `order_by="KEY"` | Sort by the primary key |
240+
| `order_by="KEY DESC"` | Sort by the primary key in descending order |
241+
| `order_by=["subject_id", "session_date"]` | Sort by `subject_id`, then sort matching `subject_id`s by their `session_date` |
241242

242-
The default values for `dj.top` parameters are `limit=1`, `order_by="KEY"`, and `offset=0`.
243+
The default values for `dj.Top` parameters are `limit=1`, `order_by="KEY"`, and `offset=0`.
243244

244245
## Restriction
245246

0 commit comments

Comments
 (0)