Skip to content

Commit 6e2e464

Browse files
committed
Doc
1 parent 0dd7bb3 commit 6e2e464

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,32 @@ end
394394

395395
See more examples of pairs queries [here.](https://github.com/tarantool/crud/blob/master/doc/pairs.md)
396396

397+
### Min and max
398+
399+
```lua
400+
-- Find the minimum value in the specified index
401+
local result, err = crud.min(space_name, 'age', opts)
402+
---
403+
- metadata:
404+
- {'name': 'id', 'type': 'unsigned'}
405+
- {'name': 'bucket_id', 'type': 'unsigned'}
406+
- {'name': 'name', 'type': 'string'}
407+
- {'name': 'age', 'type': 'number'}
408+
rows:
409+
- [1, 477, 'Elizabeth', 12]
410+
411+
-- Find the maximum value in the specified index
412+
local result, err = crud.min(space_name, 'age', opts)
413+
---
414+
- metadata:
415+
- {'name': 'id', 'type': 'unsigned'}
416+
- {'name': 'bucket_id', 'type': 'unsigned'}
417+
- {'name': 'name', 'type': 'string'}
418+
- {'name': 'age', 'type': 'number'}
419+
rows:
420+
- [5, 1172, 'Jack', 35]
421+
```
422+
397423
### Cut extra rows
398424

399425
You could use `crud.cut_rows` function to cut off scan key and primary key values that were merged to the select/pairs partial result (select/pairs with `fields` option).

0 commit comments

Comments
 (0)