SDK
SDK Jvm v1.x
2

updateSpecifications #

The updateSpecifications method allows you to create or update the validation specifications for a collection.

When the validation specification is not formatted correctly, a detailed error message is returned to help you to debug.


:::: tabs ::: tab Java

Arguments #

Copied to clipboard!
public CompletableFuture<Map<String, Object>> updateSpecifications(
      final String index,
      final String collection,
      final Map<String, Object> specifications)

Arguments Type Description
index
String
Index name
collection
String
Collection name
specifications
Map<String, Object>
Specifications to update

specifications #

A Map<String, Object> representing the specifications.

It must follow the Specification Structure.

Returns #

Returns a Map<String, Object> containing the specifications.

Usage #

Copied to clipboard!
Map<String, Object> specifications = new HashMap<>();
Map<String, Object> fields = new HashMap<>();
Map<String, Object> license = new HashMap<>();
specifications.put("strict", false);
license.put("mandatory", true);
license.put("type", "string");
fields.put("license", license);
specifications.put("fields", fields);
Map<String, Object> result = kuzzle
  .getCollectionController()
  .updateSpecifications("nyc-open-data", "yellow-taxi", specifications)
  .get();
/*
  {
    strict=false,
    fields={
      license={
        mandatory=true,
        type="string"
      }
      }
    }
 */

:::

::::