From acac5172191267543fc4e15b401e195294e04e5a Mon Sep 17 00:00:00 2001 From: Jan Christoph Uhde Date: Wed, 4 Mar 2020 09:17:02 +0100 Subject: [PATCH 1/3] Add DocuBlocks for document validation. --- .../Rest/Collections/put_api_collection_properties.md | 7 +++++++ Documentation/DocuBlocks/collectionDatabaseCreate.md | 5 +++++ Documentation/DocuBlocks/collectionProperties.md | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/Documentation/DocuBlocks/Rest/Collections/put_api_collection_properties.md b/Documentation/DocuBlocks/Rest/Collections/put_api_collection_properties.md index 508251f236b4..cb6e97336e29 100644 --- a/Documentation/DocuBlocks/Rest/Collections/put_api_collection_properties.md +++ b/Documentation/DocuBlocks/Rest/Collections/put_api_collection_properties.md @@ -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 document valiation. + The keys `rule`, `level` and `message` must follow the rules documented in + [Document Validation](document-validation.html) + On success an object with the following attributes is returned: - *id*: The identifier of the collection. @@ -62,6 +66,9 @@ 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*: Object describing the document validation used for this + collection. + **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. diff --git a/Documentation/DocuBlocks/collectionDatabaseCreate.md b/Documentation/DocuBlocks/collectionDatabaseCreate.md index 30f5fbc2fe97..22a0007c8349 100644 --- a/Documentation/DocuBlocks/collectionDatabaseCreate.md +++ b/Documentation/DocuBlocks/collectionDatabaseCreate.md @@ -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 document valiation. The keys + `rule`, `level` and `message` must follow the rules documented in + [Document Validation](document-validation.html) + `db._create(collection-name, properties, type)` Specifies the optional *type* of the collection, it can either be *document* diff --git a/Documentation/DocuBlocks/collectionProperties.md b/Documentation/DocuBlocks/collectionProperties.md index d47c62ae69be..f4f686d8bd39 100644 --- a/Documentation/DocuBlocks/collectionProperties.md +++ b/Documentation/DocuBlocks/collectionProperties.md @@ -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 valiation. The keys + `rule`, `level` and `message` must follow the rules documented in + [Document Validation](document-validation.html) + In a cluster setup, the result will also contain the following attributes: * *numberOfShards*: the number of shards of the collection. From 6a07ca645a963d6fc229e33e10d58e5ff30af051 Mon Sep 17 00:00:00 2001 From: Jan Christoph Uhde Date: Sat, 14 Mar 2020 17:49:07 +0100 Subject: [PATCH 2/3] Add missing docublocks. --- .../DocuBlocks/Rest/Collections/post_api_collection.md | 5 +++++ .../Rest/Collections/put_api_collection_properties.md | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Documentation/DocuBlocks/Rest/Collections/post_api_collection.md b/Documentation/DocuBlocks/Rest/Collections/post_api_collection.md index e211bff82dbb..5a76d5f9470f 100644 --- a/Documentation/DocuBlocks/Rest/Collections/post_api_collection.md +++ b/Documentation/DocuBlocks/Rest/Collections/post_api_collection.md @@ -54,6 +54,11 @@ 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 document valiation. The +keys `rule`, `level` and `message` must follow the rules documented in +[Document Validation](document-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*.
diff --git a/Documentation/DocuBlocks/Rest/Collections/put_api_collection_properties.md b/Documentation/DocuBlocks/Rest/Collections/put_api_collection_properties.md index cb6e97336e29..48575daf6715 100644 --- a/Documentation/DocuBlocks/Rest/Collections/put_api_collection_properties.md +++ b/Documentation/DocuBlocks/Rest/Collections/put_api_collection_properties.md @@ -66,8 +66,10 @@ 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*: Object describing the document validation used for this - collection. +* *validation* (optional, default is *null*, **rocksdb-only**): + Object that specifies the collection level document valiation. The keys + `rule`, `level` and `message` must follow the rules documented in + [Document Validation](document-validation.html) **Note**: except for *waitForSync*, *journalSize* and *name*, collection properties **cannot be changed** once a collection is created. To rename From 22e6db5d69f1c4f35be550df33fa97706cd48b26 Mon Sep 17 00:00:00 2001 From: Simran Brucherseifer Date: Mon, 16 Mar 2020 16:55:01 +0100 Subject: [PATCH 3/3] Review --- .../Rest/Collections/post_api_collection.md | 8 ++++---- .../Collections/put_api_collection_properties.md | 14 +++++++------- .../DocuBlocks/collectionDatabaseCreate.md | 6 +++--- Documentation/DocuBlocks/collectionProperties.md | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Documentation/DocuBlocks/Rest/Collections/post_api_collection.md b/Documentation/DocuBlocks/Rest/Collections/post_api_collection.md index 5a76d5f9470f..cd1d72b899e2 100644 --- a/Documentation/DocuBlocks/Rest/Collections/post_api_collection.md +++ b/Documentation/DocuBlocks/Rest/Collections/post_api_collection.md @@ -55,16 +55,16 @@ 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 document valiation. The -keys `rule`, `level` and `message` must follow the rules documented in -[Document Validation](document-validation.html) +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*.
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 diff --git a/Documentation/DocuBlocks/Rest/Collections/put_api_collection_properties.md b/Documentation/DocuBlocks/Rest/Collections/put_api_collection_properties.md index 48575daf6715..042dd85d3e19 100644 --- a/Documentation/DocuBlocks/Rest/Collections/put_api_collection_properties.md +++ b/Documentation/DocuBlocks/Rest/Collections/put_api_collection_properties.md @@ -28,9 +28,9 @@ 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 document valiation. - The keys `rule`, `level` and `message` must follow the rules documented in - [Document Validation](document-validation.html) +- *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: @@ -66,10 +66,10 @@ 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 document valiation. The keys - `rule`, `level` and `message` must follow the rules documented in - [Document Validation](document-validation.html) +* *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 diff --git a/Documentation/DocuBlocks/collectionDatabaseCreate.md b/Documentation/DocuBlocks/collectionDatabaseCreate.md index 22a0007c8349..64e2af4decdc 100644 --- a/Documentation/DocuBlocks/collectionDatabaseCreate.md +++ b/Documentation/DocuBlocks/collectionDatabaseCreate.md @@ -113,9 +113,9 @@ to the [naming conventions](../NamingConventions/README.md). This option is meaningful for the MMFiles storage engine only. * *validation* (optional, default is *null*, **rocksdb-only**): - Object that specifies the collection level document valiation. The keys - `rule`, `level` and `message` must follow the rules documented in - [Document Validation](document-validation.html) + 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)` diff --git a/Documentation/DocuBlocks/collectionProperties.md b/Documentation/DocuBlocks/collectionProperties.md index f4f686d8bd39..2005802f22eb 100644 --- a/Documentation/DocuBlocks/collectionProperties.md +++ b/Documentation/DocuBlocks/collectionProperties.md @@ -45,9 +45,9 @@ Returns an object containing all collection properties. time. * *validation* (optional, default is *null*, **rocksdb-only**): - Object that specifies the collection level document valiation. The keys - `rule`, `level` and `message` must follow the rules documented in - [Document Validation](document-validation.html) + 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: