SDK
SDK Golang v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

Truncate #

Removes all documents from a collection while keeping the associated mapping.
It is faster than deleting all documents from a collection.

Arguments #

Copied to clipboard!
Truncate(index string, collection string, options types.QueryOptions) error
Arguments Type Description
index
string
Index name
collection
string
Collection name
options
types.QueryOptions
Query options

options #

Additional query options

Property Type Description Default
queuable
bool
Make this request queuable or not true

Return #

Return an error is something was wrong.

Usage #

Copied to clipboard!
err := kuzzle.Collection.Truncate("nyc-open-data", "yellow-taxi", nil)
if err != nil {
  log.Fatal(err)
} else {
  fmt.Println("Success")
}