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

space_object:truncate()

object space_object
space_object:truncate()

Deletes all tuples. The method is performed in background and doesn’t block consequent requests.

Parameters:

Complexity factors: Index size, Index type, Number of tuples accessed.

Return:nil

The truncate method can only be called by the user who created the space, or from within a setuid function created by the user who created the space. Read more about setuid functions in the reference for box.schema.func.create().

Note

Do not call this method within a transaction in Tarantool older than v. 2.10.0. See gh-6123 for details.

Example:

tarantool> box.space.tester:truncate()
---
...
tarantool> box.space.tester:len()
---
- 0
...
Found what you were looking for?
Feedback