8000 Docs: Add DocuBlocks for document validation. by Simran-B · Pull Request #11228 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Docs: Add DocuBlocks for document validation. #11228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in 8000 to your account

Merged
merged 3 commits into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,17 @@ This option is meaningful for the MMFiles storage engine only.
additional options for key generation. If specified, then *keyOptions*
should be a JSON array containing the following attributes:

@RESTBODYPARAM{validation,object,optional,post_api_collection_opts}
Optional object that specifies the collection level schema validation for
documents. The attribute keys `rule`, `level` and `message` must follow the
rules documented in [Document Schema Validation](https://www.arangodb.com/docs/devel/document-schema-validation.html)

@RESTSTRUCT{type,post_api_collection_opts,string,required,string}
specifies the type of the key generator. The currently available generators are
*traditional*, *autoincrement*, *uuid* and *padded*.<br>
The *traditional* key generator generates numerical keys in ascending order.
The *autoincrement* key generator generates numerical keys in ascending order,
the inital offset and the spacing can be configured
the initial offset and the spacing can be configured
The *padded* key generator generates keys of a fixed length (16 bytes) in
ascending lexicographical sort order. This is ideal for usage with the _RocksDB_
engine, which will slightly benefit keys that are inserted in lexicographically
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ attribute(s)
additional journals or datafiles that are created. Already
existing journals or datafiles will not be affected.

- *validation*: Object that specifies the collection level schema validation
for documents. The attribute keys `rule`, `level` and `message` must follow
the rules documented in [Document Schema Validation](https://www.arangodb.com/docs/devel/document-schema-validation.html)

On success an object with the following attributes is returned:

- *id*: The identifier of the collection.
Expand Down Expand Up @@ -62,6 +66,11 @@ On success an object with the following attributes is returned:
generating keys and supplying own key values in the *_key* attribute
of documents is considered an error.

* *validation* (optional, default is *null*, **rocksdb-only**):
Object that specifies the collection level schema validation for documents.
The attribute keys `rule`, `level` and `message` must follow the rules
documented in [Document Schema Validation](https://www.arangodb.com/docs/devel/document-schema-validation.html)

**Note**: except for *waitForSync*, *journalSize* and *name*, collection
properties **cannot be changed** once a collection is created. To rename
a collection, the rename endpoint must be used.
Expand Down
5 changes: 5 additions & 0 deletions Documentation/DocuBlocks/collectionDatabaseCreate.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ to the [naming conventions](../NamingConventions/README.md).
time.
This option is meaningful for the MMFiles storage engine only.

* *validation* (optional, default is *null*, **rocksdb-only**):
Object that specifies the collection level schema validation for documents.
The attribute keys `rule`, `level` and `message` must follow the rules
documented in [Document Schema Validation](https://www.arangodb.com/docs/devel/document-schema-validation.html)

`db._create(collection-name, properties, type)`

Specifies the optional *type* of the collection, it can either be *document*
Expand Down
5 changes: 5 additions & 0 deletions Documentation/DocuBlocks/collectionProperties.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ Returns an object containing all collection properties.
Changes (see below) are applied when the collection is loaded the next
time.

* *validation* (optional, default is *null*, **rocksdb-only**):
Object that specifies the collection level document validation for documents.
The attribute keys `rule`, `level` and `message` must follow the rules
documented in [Document Schema Validation](https://www.arangodb.com/docs/devel/document-schema-validation.html)

In a cluster setup, the result will also contain the following attributes:

* *numberOfShards*: the number of shards of the collection.
Expand Down
0