validate method

Future<bool> validate(
  1. String index,
  2. String collection,
  3. Map<String, dynamic> document
)

Validates data against existing validation rules.

Documents are always valid if no validation rules are defined on the provided index and collection.

This request does not store the document.

Implementation

Future<bool> validate(
  String index,
  String collection,
  Map<String, dynamic> document,
) async {
  final response = await kuzzle.query(KuzzleRequest(
    controller: name,
    action: 'validate',
    index: index,
    collection: collection,
    body: document,
  ));

  return (response.result as Map<String, dynamic>)['valid'] as bool;
}