SDK
SDK Jvm v1.x
2

truncate #

Removes all documents from a collection, while keeping the associated mappings and settings.


:::: tabs ::: tab Java

Arguments #

public CompletableFuture<Void> truncate(
      final String index,
      final String collection) throws NotConnectedException, InternalException

ArgumentsTypeDescription
index
String
Index name
collection
String
Collection name

Usage #

kuzzle.getCollectionController().truncate("nyc-open-data", "yellow-taxi").get();

::: ::: tab Kotlin

Arguments #

fun truncate(
    index: String,
    collection: String
  ): CompletableFuture<Void>

ArgumentsTypeDescription
index
String
Index name
collection
String
Collection name

Usage #

kuzzle.collectionController.truncate("nyc-open-data", "yellow-taxi").get();

::: ::::