SDK
SDK Jvm v1.x
2

getSpecifications #

Returns the validation specifications associated to the given index and collection.


:::: tabs ::: tab Java

Arguments #

  public CompletableFuture<Map<String, Object>> getSpecifications(
      final String index,
      final String collection)

ArgumentsTypeDescription
index
String
Index name
collection
String
Collection name

Returns #

Returns a Map<String, Object> representing the collection specifications.

Usage #

Map<String, Object> result = kuzzle
  .getCollectionController()
  .getSpecifications("nyc-open-data", "yellow-taxi")
  .get();
/*
  {
    collection="yellow-taxi",
    index="nyc-open-data",
    validation={
      fields={
        age={
          defaultValue=42,
          mandatory=true,
          type="integer"
        }
      },
      strict=true
    }
  }
*/

::: ::: tab Kotlin

Arguments #

fun getSpecifications(
    index: String,
    collection: String
  ): CompletableFuture<Map<String, Any?>>
ArgumentsTypeDescription
index
String
Index name
collection
String
Collection name

Returns #

Returns a Map<String, Any?> representing the collection specifications.

Usage #

val result = kuzzle
  .collectionController
  .getSpecifications("nyc-open-data", "yellow-taxi")
  .get()
/*
  {
    collection="yellow-taxi",
    index="nyc-open-data",
    validation={
      fields={
        age={
          defaultValue=42,
          mandatory=true,
          type="integer"
        }
      },
      strict=true
    }
  }
*/

::: ::::