index_object:max() | Tarantool
Tarantool
Check out the new release policy

index_object:max()

object index_object
index_object:max([key])

Find the maximum value in the specified index.

Parameters:
Return:

the tuple for the last key in the index. If the optional key value is supplied, returns the last key that is less than or equal to key. Starting with Tarantool 2.0.4, index_object:max(key) returns nothing if key doesn’t match any value in the index.

Rtype:

tuple

Possible errors: index is not of type ‘TREE’.

Complexity factors: index size, index type.

Example:

tarantool> box.space.tester.index.primary:max()
---
- ['Gamma!', 55, 'This is the third tuple!']
...