Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Latest commit

 

History

History
58 lines (40 loc) · 1.81 KB

File metadata and controls

58 lines (40 loc) · 1.81 KB
code type title description
true
page
validate
Validate a document

validate

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.

Signature

bool validate(
    const std::string& index,
    const std::string& collection,
    const std::string& document);

bool validate(
    const std::string& index,
    const std::string& collection,
    const std::string& document,
    const kuzzleio::query_options& options);

Arguments

Argument Type Description
index
const std::string&
Index name
collection
const std::string&
Collection name
document
const std::string&
JSON string representing the document
options
kuzzleio::query_options*
Query options

options

Additional query options

Option Type
(default)
Description
queuable
bool

(true)
If true, queues the request during downtime, until connected to Kuzzle again

Return

A boolean set to true if the document is valid and false otherwise.

Exceptions

Throws a kuzzleio::KuzzleException if there is an error. See how to handle errors.

Usage

<<< ./snippets/validate.cpp