space_object:count() | Tarantool
Submodule box.space space_object:count()

space_object:count()

object space_object
space_object:count([key][, iterator])

Return the number of tuples. If compared with len(), this method works slower because count() scans the entire space to count the tuples.

Parameters:
  • space_object (space_object) – an object reference
  • key (scalar/table) – primary-key field values, must be passed as a Lua table if key is multi-part
  • iterator – comparison method
Return:

Number of tuples.

Possible errors:

Example:

tarantool> box.space.tester:count(2, {iterator='GE'})
---
- 1
...
Found what you were looking for?
Feedback