Top.Mail.Ru
space_object:count() | Tarantool
Tarantool
Check out the new release 2.8
Submodule box.space space_object:count()

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.

Example:

tarantool> box.space.tester:count(2, {iterator='GE'})
---
- 1
...