"SequoiaDB Giant Sequoia Database" truncate() Overview 1

grammar

db.collectionspace.collection.truncate()

truncate will delete all data in the collection (including ordinary documents and LOB data), but will not affect its metadata. Unlike remove, which needs to filter targets according to conditions, truncate will directly release the data page, which is more efficient than remove when clearing the data in the collection (especially under large data volumes).

Note:

If there is an auto-increment field, the field sequence value will be reset after truncate.

Parameter Description

no

return value

No return value, Throws an error, and outputs the error, by getLastErrMsg () Gets error message or by getLastError () Gets error code.

Click on Jushan Database Documentation Center for more information

Guess you like

Origin blog.csdn.net/weixin_48909806/article/details/112983457