The CollectionOptions class defines collection create/modify options.
More...
The CollectionOptions class defines collection create/modify options.
◆ Option
◆ CollectionOptions() [1/2]
Constructor using a document.
Document example:
{
"reuseExisting": true,
"validation":
{
"level": "Strict",
"schema":
{
"id": "http://json-schema.org/geo",
"$schema": "http://json-schema.org/draft-06/schema#",
"description": "A geographical coordinate",
"type": "object",
"properties":
{
"latitude":
{
"type": "number"
},
"longitude":
{
"type": "number"
}
},
"required": ["latitude", "longitude"]
}
}
}
}
Document keys:
◆ CollectionOptions() [2/2]
Construct CollectionOptions from list of Option and value pairs.
CollectionOptions::Option and CollectionValidation::Option can both be used.
Example:
schema.createCollection(
"collection_test",
R"(
{
"id": "http://json-schema.org/geo",
"$schema": "http://json-schema.org/draft-06/schema#",
"description": "A geographical coordinate",
"type": "object",
"properties":
{
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
}
},
"required": ["latitude", "longitude"]
})"
);
@ REUSE
Definition: xdevapi.h:312
@ SCHEMA
Definition: xdevapi.h:146
@ LEVEL
Definition: xdevapi.h:146
@ STRICT
Definition: xdevapi.h:136
◆ set()
void set |
( |
Rest &&... |
rest | ) |
|
|
inline |
Set list of option and value pairs.
- See also
- CollectionOptions::CollectionOptions
The documentation for this class was generated from the following file: