From 5f5d95dca7ebd9dc1864255bd29f8c35a8e137df Mon Sep 17 00:00:00 2001 From: Aschen Date: Wed, 27 Mar 2019 07:31:48 +0100 Subject: [PATCH 1/8] Add database-mappings page --- .../1/controller-collection/create/index.md | 16 +- .../1/essentials/database-mappings/index.md | 167 ++++++++++++++++++ src/guide/1/essentials/persisted/index.md | 52 +----- 3 files changed, 183 insertions(+), 52 deletions(-) create mode 100644 src/guide/1/essentials/database-mappings/index.md diff --git a/src/api/1/controller-collection/create/index.md b/src/api/1/controller-collection/create/index.md index e5121cba8..d5d6ca69a 100644 --- a/src/api/1/controller-collection/create/index.md +++ b/src/api/1/controller-collection/create/index.md @@ -13,7 +13,21 @@ Creates a new [collection]({{ site_base_path }}guide/1/essentials/persisted), in You can also provide an optional body with a data mapping that allow you to exploit the full capabilities of our persistent data storage layer. -This method will only update the mapping if the collection already exists. +This method will only update the mapping when the collection already exists. + +{{{since "1.7.1"}}} + +For each collection, you can set the policy against new fields that are not referenced in the collection mapping +The value of this configuration will change the way Elasticsearch manages the creation of new fields that are not declared in the collection mapping. + - "true": Stores the document and updates the collection mapping with the inferred type + - "false": Stores the document and does not update the collection mapping (fields are not indexed) + - "strict": Rejects the document + +See https://www.elastic.co/guide/en/elasticsearch/guide/current/dynamic-mapping.html + +_meta => nepalea: { liaa: 'meh ry' } + +dynamic --- diff --git a/src/guide/1/essentials/database-mappings/index.md b/src/guide/1/essentials/database-mappings/index.md new file mode 100644 index 000000000..a3e437818 --- /dev/null +++ b/src/guide/1/essentials/database-mappings/index.md @@ -0,0 +1,167 @@ +--- +layout: full.html.hbs +title: Define database mapping +order: 400 +--- + +# Database mappings + +With Elasticsearch, it is possible to define mappings for collections. These mappings allow you to configure the way Elasticsearch will handle these collections. + +There are 3 root fields for mapping configuration: + - `dynamic`: dynamic mapping policy against new fields + - `_meta`: collection metadata + - `properties`: collection types definition + +The following API methods can be used to modify these mappings: + - [collection:create]({{ site_base_path }}api/1/controller-collection/create/) + - [collection:updateMapping]({{ site_base_path }}api/1/controller-collection/update-mapping/) + +--- + +## Properties types definition + +The definition of the types of fields that will be inserted in a collection allows Elasticsearch to optimize the indexing of your data for future searches. + +Especially when searching on special fields such as `date` or `geo_shape` types. + +
+Once a type has been defined for a field, it is not possible to modify it later. +
+ +Refer to the Elasticsearch documentation for an exhaustive list of available types: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping-types.html + +### Example + +If I want the following document to be correctly indexed: +```javascript +{ + "category": "limousine", + "distance": 120990, + "position": { + "lat": 27.730400, + "lon": 85.328467 + }, + "driver": { + "name": "liia" + } +} +``` + +The following mapping must first be defined: +```javascript +{ + "properties": { + "category": { "type": "keyword" }, + "distance": { "type": "integer" }, + "position": { "type": "geo_point" }, + "driver": { + "properties": { + "name": { "type": "keyword" } + } + } + } +} +``` + +This mapping is then passed in the body to the methods [collection:create]({{ site_base_path }}api/1/controller-collection/create/) or [collection:updateMapping]({{ site_base_path }}api/1/controller-collection/update-mapping/). + +```bash +# First create a collection yellow-taxi in the nyc-open-data index +curl -X PUT -d '{"properties":{"category":{"type":"keyword"},"distance":{"type":"integer"},"position":{"type":"geo_point"},"driver":{"properties":{"name":{"type":"keyword"}}}}}' -H "Content-Type: application/json" "http://localhost:7512/nyc-open-data/yellow-taxi?pretty" + +# Then create the desired document +curl -X POST -d '{"category":"limousine","distance":120990,"position":{"lat":27.7304,"lon":85.328467},"driver":{"name":"liia"}}' -H "Content-Type: application/json" "http://localhost:7512/nyc-open-data/yellow-taxi/_create?pretty" +``` + +
+Because of the way Elasticsearch manages collections, mappings are shared between indexes. +
+This means that if I have an index nyc-open-data, two collections yellow-taxi and green-taxi and a field name with type keyword in the collection yellow-taxi, I couldn't have a field name with a different type in the collection green-taxi. +
+ +--- + +## Dynamic mapping policy + +For each collection, you can set the policy against new fields that are not referenced in the collection mapping by modifying the `dynamic` root field. + +The value of this configuration will change the way Elasticsearch manages the creation of new fields that are not declared in the collection mapping. + - `"true"`: Stores the document and updates the collection mapping with the inferred type + - `"false"`: Stores the document and does not update the collection mapping (fields are not indexed) + - `"strict"`: Rejects the document + +Refer to Elasticsearch documentation for more informations: https://www.elastic.co/guide/en/elasticsearch/guide/current/dynamic-mapping.html + +The default policy for new collections is `"true"` and is configurable in the [kuzzlerc]({{ site_base_path }}guide/1/essentials/configuration/) file under the key `services.db.dynamic`. + +
+We advise not to let Elasticsearch dynamically infer the type of new fields in production. +
+This can be a problem because then the mapping cannot be modified. +
+ +It is also possible to specify a different dynamic mapping policy for nested fields. This can be useful in imposing a strict policy on the collection while allowing the introduction of new fields in a specific location. + +### Example + +If you want a `strict` dynamic policy for your entire collection, you have to define it in root level but you can have a different policy for nested types: + +```javascript +{ + "dynamic": "strict" + "properties": { + "driver": { + "dynamic": "false" + "properties": // allow insertion of new fields in the driver + } + } +} +``` +
+```bash +# Define a strict dynamic policy for the yellow-taxi collection +curl -X PUT -d '{ "dynamic": "strict" }' -H "Content-Type: application/json" "http://localhost:7512/nyc-open-data/yellow-taxi?pretty" + +# Try to create a document with a field that is not referenced in the mapping +curl -X POST -d '{"language":"nepali"}' -H "Content-Type: application/json" "http://localhost:7512/nyc-open-data/yellow-taxi/_create?pretty" + +# You should see an error with the following message: +# "mapping set to strict, dynamic introduction of [language] within [yellow-taxi] is not allowed" +``` + +--- + +## Collection metadata + +Elasticsearch allows the definition of metadata that is stored next to the collections in the root field `_meta`. +These metadata are ignored by Elasticsearch, they can contain any type of information specific to your application. + +Refer to Elasticsearch documentation for more informations: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping-meta-field.html + +### Example + +```javascript +{ + "_meta": { + "driversPerimeter": "Panipokhari" + } +} +``` +
+```bash +# Add collection metadata +curl -X PUT -d '{ "_meta": { "driversPerimeter": "Panipokhari" } }' -H "Content-Type: application/json" "http://localhost:7512/nyc-open-data/yellow-taxi/_mapping?pretty" + +# Retrieve it +curl -X GET -H "Content-Type: application/json" "http://localhost:7512/nyc-open-data/yellow-taxi/_mapping?pretty" +``` + +--- + +## What Now? + +* Learn to work with [Persistent Data]({{ site_base_path }}guide/1/essentials/persisted) +* Read our [Elasticsearch Cookbook]({{ site_base_path }}guide/1/elasticsearch) to learn more about how querying works in Kuzzle +* Use [document metadata]({{ site_base_path }}guide/1/essentials/document-metadata) to find or recover documents +* Keep track of data changes using [Real-time Notifications]({{ site_base_path }}guide/1/essentials/real-time) diff --git a/src/guide/1/essentials/persisted/index.md b/src/guide/1/essentials/persisted/index.md index d479f16e3..50ecd8914 100644 --- a/src/guide/1/essentials/persisted/index.md +++ b/src/guide/1/essentials/persisted/index.md @@ -84,7 +84,7 @@ You should receive the following response: } ``` -**Note:** we have just created a new collection without specifying any mappings. As a result, the database layer will automatically create a mapping that assigns a best guess data type to any new field it detects in input documents. Since these mappings cannot be changed once they are created, we strongly recommend that you [**create your own mappings**]({{ site_base_path }}guide/1/essentials/persisted/#mappings) as soon as the collection has been created. For the purpose of this tutorial, we will continue without defining our own mappings. +**Note:** we have just created a new collection without specifying any mappings. As a result, the database layer will automatically create a mapping that assigns a best guess data type to any new field it detects in input documents. Since these mappings cannot be changed once they are created, we strongly recommend that you [**create your own mappings**]({{ site_base_path }}guide/1/essentials/database-mappings) as soon as the collection has been created. For the purpose of this tutorial, we will continue without defining our own mappings. --- @@ -492,56 +492,6 @@ You should receive the following response (with your own `_id` values): --- -## Mappings - -Kuzzle uses Elasticsearch as a persistent document store, which uses mappings to assign a type to a document field. These mappings are attached to a `collection` (aka `type` in Elasticsearch terminology) and are automatically inferred from input documents if no mappings are preconfigured. - -If you want to control how Kuzzle interprets your documents, we recommend that you configure your own mappings using our mappings creation endpoint. - -Create a mapping by sending a `PUT` request to the `http://localhost:7512///_mapping` and setting the mapping in the request body. - -Use [this](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping.html) syntax when definng a mapping. For example, if we want to create a mapping that will define a field `birthday` as a `date` type, we would send the following JSON in the body: - -```json -{ - "properties": { - "birthday": { - "type": "date" - } - } -} -``` - -Let's try it: - -```bash - curl -X PUT -H "Content-Type: application/json" -d '{"properties":{"birthday":{"type": "date"}}}' http://localhost:7512/myindex/mycollection/_mapping -``` - -You should receive the following response: - -```json -{ - "requestId": "", - "status": 200, - "error": null, - "controller": "collection", - "action": "updateMapping", - "collection": "mycollection", - "index": "myindex", - "volatile": null, - "result": { - "acknowledged": true - } -} -``` - -Here we have now defined the type `date` for the field labeled `birthday` in our `mycollection` collection. Defining types in this way can be especially useful when dealing with specific types (`date`, `geo_shape`, etc.), full-text search, or complex data structures. - -Please note that the mappings of a collection cannot be updated once they are created, this is true whether you create the rules yourself using our API or whether Elasticsearch generates the rules automatically based on the input documents it processes. Because of this, you should almost always define mappings when you first create your collections and before creating any documents. - ---- - ## What Now? From 8b0dad472ac5168aa7c05282b02e67993d65ffa9 Mon Sep 17 00:00:00 2001 From: Aschen Date: Wed, 27 Mar 2019 08:01:03 +0100 Subject: [PATCH 2/8] Update collection API methods --- .../1/controller-collection/create/index.md | 38 ++++++++-------- .../get-mapping/index.md | 44 +++++++++++-------- .../update-mapping/index.md | 33 ++++++++++---- .../1/essentials/database-mappings/index.md | 10 +++-- 4 files changed, 77 insertions(+), 48 deletions(-) diff --git a/src/api/1/controller-collection/create/index.md b/src/api/1/controller-collection/create/index.md index d5d6ca69a..8edbf5dbc 100644 --- a/src/api/1/controller-collection/create/index.md +++ b/src/api/1/controller-collection/create/index.md @@ -11,23 +11,15 @@ Creates a new [collection]({{ site_base_path }}guide/1/essentials/persisted), in {{{since "1.3.0"}}} -You can also provide an optional body with a data mapping that allow you to exploit the full capabilities of our persistent data storage layer. +You can also provide an optional body with a [collection mapping]({{ site_base_path }}guide/1/essentials/database-mappings) that allow you to exploit the full capabilities of our persistent data storage layer. This method will only update the mapping when the collection already exists. {{{since "1.7.1"}}} -For each collection, you can set the policy against new fields that are not referenced in the collection mapping -The value of this configuration will change the way Elasticsearch manages the creation of new fields that are not declared in the collection mapping. - - "true": Stores the document and updates the collection mapping with the inferred type - - "false": Stores the document and does not update the collection mapping (fields are not indexed) - - "strict": Rejects the document - -See https://www.elastic.co/guide/en/elasticsearch/guide/current/dynamic-mapping.html +You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. -_meta => nepalea: { liaa: 'meh ry' } - -dynamic +You can define [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) within the `_meta` root field. --- @@ -43,6 +35,10 @@ Body: ```js { + "dynamic": "false", + "_meta": { + "field": "value" + }, "properties": { "field1": { "type": "integer" @@ -51,8 +47,8 @@ Body: "type": "keyword" }, "field3": { - "type": "date", - "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" + "type": "date", + "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" } } } @@ -68,6 +64,10 @@ Body: "controller": "collection", "action": "create", "body": { + "dynamic": "false", + "_meta": { + "field": "value" + }, "properties": { "field1": { "type": "integer" @@ -76,8 +76,8 @@ Body: "type": "keyword" }, "field3": { - "type": "date", - "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" + "type": "date", + "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" } } } @@ -88,8 +88,8 @@ Body: ## Arguments -* `collection`: data collection to create -* `index`: data index that will host the new data collection +* `collection`: name of the collection to create +* `index`: index that will host the new collection --- @@ -97,7 +97,9 @@ Body: ### Optional: -* `properties`: object describing the data mapping to associate to the new collection, using [Elasticsearch mapping format](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping.html). +* `dynamic`: [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) for new fields +* `_meta`: [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) stored next to the collection +* `properties`: object describing the data mapping to associate to the new collection, using [Elasticsearch types definitions format]({{ site_base_path}}guide/1/essentials/database-mappings/#properties-types-definition) --- diff --git a/src/api/1/controller-collection/get-mapping/index.md b/src/api/1/controller-collection/get-mapping/index.md index 114bd77d8..3c43842ba 100644 --- a/src/api/1/controller-collection/get-mapping/index.md +++ b/src/api/1/controller-collection/get-mapping/index.md @@ -7,7 +7,11 @@ title: getMapping {{{since "1.0.0"}}} -Returns a data collection mapping. +Returns the collection mapping. + +{{{since "1.7.1"}}} + +Also returns the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) and [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata). --- @@ -36,8 +40,8 @@ Method: GET ## Arguments -* `collection`: data collection -* `index`: data index +* `collection`: collection name +* `index`: index name --- @@ -47,13 +51,17 @@ Returns a mapping object with the following structure: ``` - |- mappings - |- - |- properties - |- mapping for field 1 - |- mapping for field 2 - |- ... - |- mapping for field n + |- mappings + |- + |- dynamic + |- _meta + |- metadata 1 + |- metadata 1 + |- properties + |- mapping for field 1 + |- mapping for field 2 + |- ... + |- mapping for field n ``` ### Example: @@ -71,16 +79,16 @@ Returns a mapping object with the following structure: "": { "mappings": { "": { + "dynamic": "true", + "_meta": { + "metadata1": "value1" + }, "properties": { - "field1": { - "type": "integer" - }, - "field2": { - "type": "keyword" - }, + "field1": { "type": "integer" }, + "field2": { "type": "keyword" }, "field3": { - "type": "date", - "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" + "type": "date", + "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" } } } diff --git a/src/api/1/controller-collection/update-mapping/index.md b/src/api/1/controller-collection/update-mapping/index.md index ae950937e..9a22762d0 100644 --- a/src/api/1/controller-collection/update-mapping/index.md +++ b/src/api/1/controller-collection/update-mapping/index.md @@ -9,6 +9,12 @@ title: updateMapping Updates a data collection mapping. +{{{since "1.7.1"}}} + +You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. + +You can define [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) within the `_meta` root field. + --- ## Query Syntax @@ -23,6 +29,10 @@ Body: ```js { + "dynamic": "false", + "_meta": { + "field": "value" + }, "properties": { "field1": { "type": "integer" @@ -31,8 +41,8 @@ Body: "type": "keyword" }, "field3": { - "type": "date", - "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" + "type": "date", + "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" } } } @@ -46,8 +56,11 @@ Body: "collection": "", "controller": "collection", "action": "updateMapping", - "body": { + "dynamic": "false", + "_meta": { + "field": "value" + }, "properties": { "field1": { "type": "integer" @@ -56,8 +69,8 @@ Body: "type": "keyword" }, "field3": { - "type": "date", - "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" + "type": "date", + "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" } } } @@ -68,14 +81,18 @@ Body: ## Arguments -* `collection`: data collection -* `index`: data index +* `collection`: name of the collection to create +* `index`: index that will host the new collection --- ## Body properties -* `properties`: object describing the data mapping to associate to the new collection, using [Elasticsearch mapping format](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping.html). +### Optional: + +* `dynamic`: [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) for new fields +* `_meta`: [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) stored next to the collection +* `properties`: object describing the data mapping to associate to the new collection, using [Elasticsearch types definitions format]({{ site_base_path}}guide/1/essentials/database-mappings/#properties-types-definition) --- diff --git a/src/guide/1/essentials/database-mappings/index.md b/src/guide/1/essentials/database-mappings/index.md index a3e437818..de4361051 100644 --- a/src/guide/1/essentials/database-mappings/index.md +++ b/src/guide/1/essentials/database-mappings/index.md @@ -43,7 +43,7 @@ If I want the following document to be correctly indexed: "lon": 85.328467 }, "driver": { - "name": "liia" + "name": "liia mhe ry" } } ``` @@ -71,7 +71,7 @@ This mapping is then passed in the body to the methods [collection:create]({{ si curl -X PUT -d '{"properties":{"category":{"type":"keyword"},"distance":{"type":"integer"},"position":{"type":"geo_point"},"driver":{"properties":{"name":{"type":"keyword"}}}}}' -H "Content-Type: application/json" "http://localhost:7512/nyc-open-data/yellow-taxi?pretty" # Then create the desired document -curl -X POST -d '{"category":"limousine","distance":120990,"position":{"lat":27.7304,"lon":85.328467},"driver":{"name":"liia"}}' -H "Content-Type: application/json" "http://localhost:7512/nyc-open-data/yellow-taxi/_create?pretty" +curl -X POST -d '{"category":"limousine","distance":120990,"position":{"lat":27.7304,"lon":85.328467},"driver":{"name":"liia meh ry"}}' -H "Content-Type: application/json" "http://localhost:7512/nyc-open-data/yellow-taxi/_create?pretty" ```
@@ -139,19 +139,21 @@ These metadata are ignored by Elasticsearch, they can contain any type of inform Refer to Elasticsearch documentation for more informations: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping-meta-field.html +These metadata can be retrieved with the [collection:getMapping]({{ site_base_path }}api/1/controller-collection/get-mapping/) API method. + ### Example ```javascript { "_meta": { - "driversPerimeter": "Panipokhari" + "area": "Panipokhari" } } ```
```bash # Add collection metadata -curl -X PUT -d '{ "_meta": { "driversPerimeter": "Panipokhari" } }' -H "Content-Type: application/json" "http://localhost:7512/nyc-open-data/yellow-taxi/_mapping?pretty" +curl -X PUT -d '{ "_meta": { "area": "Panipokhari" } }' -H "Content-Type: application/json" "http://localhost:7512/nyc-open-data/yellow-taxi/_mapping?pretty" # Retrieve it curl -X GET -H "Content-Type: application/json" "http://localhost:7512/nyc-open-data/yellow-taxi/_mapping?pretty" From 673ae0a3b540190e35c0c7b820b9ad8c6cb77db2 Mon Sep 17 00:00:00 2001 From: Aschen Date: Wed, 27 Mar 2019 08:01:12 +0100 Subject: [PATCH 3/8] Update collection:create in SDKs --- .../cpp/1/collection/create/index.md | 25 +++++++++++----- .../1/collection/create/snippets/create.cpp | 4 +++ .../go/1/collection/create/index.md | 30 ++++++++++++++----- .../go/1/collection/create/snippets/create.go | 2 +- .../js/6/collection/create/index.md | 22 ++++++++++---- .../js/6/collection/create/snippets/create.js | 4 +++ 6 files changed, 65 insertions(+), 22 deletions(-) diff --git a/src/sdk-reference/cpp/1/collection/create/index.md b/src/sdk-reference/cpp/1/collection/create/index.md index 997dc6a27..b8e84908a 100644 --- a/src/sdk-reference/cpp/1/collection/create/index.md +++ b/src/sdk-reference/cpp/1/collection/create/index.md @@ -6,11 +6,19 @@ description: Create a new collection # create -Creates a new [collection]({{ site_base_path }}guide/1/essentials/persisted) in Kuzzle via the persistence engine, in the provided `index`. -You can also provide an optional data mapping that allow you to exploit the full capabilities of our -persistent data storage layer, [ElasticSearch](https://www.elastic.co/products/elasticsearch) (check here the [mapping capabilities of ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/mapping.html)). +Creates a new [collection]({{ site_base_path }}guide/1/essentials/persisted) in Kuzzle via the persistence engine, in the provided index. -This method will only update the mapping if the collection already exists. +{{{since Kuzzle "1.3.0"}}} + +You can also provide an optional body with a [collection mapping]({{ site_base_path }}guide/1/essentials/database-mappings) that allow you to exploit the full capabilities of our persistent data storage layer. + +This method will only update the mapping when the collection already exists. + +{{{since Kuzzle "1.7.1"}}} + +You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. + +You can define [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) within the `_meta` root field. ## Signature @@ -40,16 +48,19 @@ void create( |--------------|---------|-------------| | `index` |
const std::string&
| Index name | | `collection` |
const std::string&
| Collection name | -| `mapping` |
const std::string*
| JSON string representing the collection data mapping | +| `mapping` |
const std::string*
| JSON string representing the collection mapping | | `options` |
kuzzleio::query_options\*
| Query options | ### mapping A JSON string representing the collection data mapping. -The mapping must have a root field `properties` that contain the mapping definition: ```json { + "dynamic": "false", + "_meta": { + "field": "value" + }, "properties": { "field1": { "type": "text" }, "field2": { @@ -61,7 +72,7 @@ The mapping must have a root field `properties` that contain the mapping definit } ``` -You can see the full list of Elasticsearch mapping types [here](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping.html). +More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings. ### options diff --git a/src/sdk-reference/cpp/1/collection/create/snippets/create.cpp b/src/sdk-reference/cpp/1/collection/create/snippets/create.cpp index d8e53b087..bd2a1747b 100644 --- a/src/sdk-reference/cpp/1/collection/create/snippets/create.cpp +++ b/src/sdk-reference/cpp/1/collection/create/snippets/create.cpp @@ -1,5 +1,9 @@ try { std::string mapping = R"({ + "dynamic": "false", + "_meta": { + "area": "Panipokhari" + }, "properties": { "license": { "type": "keyword" }, "driver": { diff --git a/src/sdk-reference/go/1/collection/create/index.md b/src/sdk-reference/go/1/collection/create/index.md index c3d77ea59..d98687d2b 100644 --- a/src/sdk-reference/go/1/collection/create/index.md +++ b/src/sdk-reference/go/1/collection/create/index.md @@ -6,9 +6,19 @@ description: Create a new collection # create -Creates a new [collection]({{ site_base_path }}guide/1/essentials/persisted) in Kuzzle via the persistence engine, in the provided `index`. -You can also provide an optional data mapping that allow you to exploit the full capabilities of our -persistent data storage layer, [ElasticSearch](https://www.elastic.co/products/elasticsearch) (check here the [mapping capabilities of ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/mapping.html)). +Creates a new [collection]({{ site_base_path }}guide/1/essentials/persisted) in Kuzzle via the persistence engine, in the provided index. + +{{{since Kuzzle "1.3.0"}}} + +You can also provide an optional body with a [collection mapping]({{ site_base_path }}guide/1/essentials/database-mappings) that allow you to exploit the full capabilities of our persistent data storage layer. + +This method will only update the mapping when the collection already exists. + +{{{since Kuzzle "1.7.1"}}} + +You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. + +You can define [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) within the `_meta` root field. This method will only update the mapping if the collection already exists. @@ -24,16 +34,19 @@ Create(index string, collection string, mapping json.RawMessage, options types.Q |--------------|---------|-------------|---------- | ``index`` | string | Index name | yes | | ``collection`` | string | Collection name | yes | -| ``mapping`` | json.RawMessage | Collection data mapping in JSON format | no | +| ``mapping`` | json.RawMessage | Collection mapping in JSON format | no | | `options` | QueryOptions | Query options | no | -### **mapping** +### mapping An string containing the JSON representation of the collection data mapping. -The mapping must have a root field `properties` that contain the mapping definition: ```json { + "dynamic": "false", + "_meta": { + "field": "value" + }, "properties": { "field1": { "type": "text" }, "field2": { @@ -43,11 +56,12 @@ The mapping must have a root field `properties` that contain the mapping definit } } } + ``` -You can see the full list of Elasticsearch mapping types [here](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/mapping.html). +More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings -### **options** +### options Additional query options diff --git a/src/sdk-reference/go/1/collection/create/snippets/create.go b/src/sdk-reference/go/1/collection/create/snippets/create.go index 712ee8115..73134752f 100644 --- a/src/sdk-reference/go/1/collection/create/snippets/create.go +++ b/src/sdk-reference/go/1/collection/create/snippets/create.go @@ -1,4 +1,4 @@ -mapping := json.RawMessage(`{"properties":{"license": {"type": "keyword"}}}`) +mapping := json.RawMessage(`{ "dynamic": "false","_meta": { "area": "Panipokhari" }, "properties":{"license": {"type": "keyword"}}}`) err := kuzzle.Collection.Create("nyc-open-data", "yellow-taxi", mapping, nil) if err != nil { diff --git a/src/sdk-reference/js/6/collection/create/index.md b/src/sdk-reference/js/6/collection/create/index.md index 451347a26..824ff0a7f 100644 --- a/src/sdk-reference/js/6/collection/create/index.md +++ b/src/sdk-reference/js/6/collection/create/index.md @@ -8,10 +8,17 @@ description: Create a new collection Creates a new [collection]({{ site_base_path }}guide/1/essentials/persisted) in Kuzzle via the persistence engine, in the provided index. -You can also provide an optional data mapping that allow you to exploit the full capabilities of our -persistent data storage layer, [ElasticSearch](https://www.elastic.co/products/elasticsearch) (check here the [mapping capabilities of ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping.html)). +{{{since Kuzzle "1.3.0"}}} -This method will only update the mapping if the collection already exists. +You can also provide an optional body with a [collection mapping]({{ site_base_path }}guide/1/essentials/database-mappings) that allow you to exploit the full capabilities of our persistent data storage layer. + +This method will only update the mapping when the collection already exists. + +{{{since Kuzzle "1.7.1"}}} + +You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. + +You can define [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) within the `_meta` root field.
@@ -25,16 +32,19 @@ create (index, collection, [mapping], [options]) |--------------|---------|-------------| | ``index`` |
string
| Index name | | ``collection`` |
string
| Collection name | -| ``mapping`` |
object
| Describes the data mapping to associate to the new collection, using Elasticsearch [mapping format](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping.html) | +| ``mapping`` |
object
| Describes the collection mapping | | ``options`` |
object
| Query options | ### mapping An object representing the data mapping of the collection. -The mapping must have a root field `properties` that contain the mapping definition: ```js const mapping = { + dynamic: 'false', + _meta: { + field: 'value' + }, properties: { field1: { type: 'text' }, field2: { @@ -46,7 +56,7 @@ const mapping = { }; ``` -You can see the full list of Elasticsearch mapping types [here](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping.html). +More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings ### options diff --git a/src/sdk-reference/js/6/collection/create/snippets/create.js b/src/sdk-reference/js/6/collection/create/snippets/create.js index 4c10502d6..f8f143513 100644 --- a/src/sdk-reference/js/6/collection/create/snippets/create.js +++ b/src/sdk-reference/js/6/collection/create/snippets/create.js @@ -1,4 +1,8 @@ const mapping = { + dynamic: 'false', + _meta: { + area: 'Panipokhari' + }, properties: { license: { type: 'keyword' }, driver: { From f67ed86dcaaa5836bf5f02d733cb3ca21b836104 Mon Sep 17 00:00:00 2001 From: Aschen Date: Wed, 27 Mar 2019 08:10:50 +0100 Subject: [PATCH 4/8] Update collection:updateMapping and getMapping in SDKs --- .../update-mapping/index.md | 2 +- .../cpp/1/collection/create/index.md | 2 +- .../cpp/1/collection/get-mapping/index.md | 2 +- .../get-mapping/snippets/get-mapping.cpp | 2 +- .../cpp/1/collection/update-mapping/index.md | 22 ++++++++++------ .../snippets/update-mapping.cpp | 4 +++ .../go/1/collection/create/index.md | 3 +-- .../go/1/collection/update-mapping/index.md | 25 ++++++++++++------- .../update-mapping/snippets/update-mapping.go | 2 +- .../js/6/collection/get-mapping/index.md | 2 +- .../get-mapping/snippets/get-mapping.js | 4 +++ .../js/6/collection/update-mapping/index.md | 23 +++++++++++------ .../update-mapping/snippets/update-mapping.js | 4 +++ 13 files changed, 66 insertions(+), 31 deletions(-) diff --git a/src/api/1/controller-collection/update-mapping/index.md b/src/api/1/controller-collection/update-mapping/index.md index 9a22762d0..81499bf7e 100644 --- a/src/api/1/controller-collection/update-mapping/index.md +++ b/src/api/1/controller-collection/update-mapping/index.md @@ -7,7 +7,7 @@ title: updateMapping {{{since "1.0.0"}}} -Updates a data collection mapping. +Updates a collection mapping. {{{since "1.7.1"}}} diff --git a/src/sdk-reference/cpp/1/collection/create/index.md b/src/sdk-reference/cpp/1/collection/create/index.md index b8e84908a..783054da7 100644 --- a/src/sdk-reference/cpp/1/collection/create/index.md +++ b/src/sdk-reference/cpp/1/collection/create/index.md @@ -53,7 +53,7 @@ void create( ### mapping -A JSON string representing the collection data mapping. +A JSON string representing the collection mapping. ```json { diff --git a/src/sdk-reference/cpp/1/collection/get-mapping/index.md b/src/sdk-reference/cpp/1/collection/get-mapping/index.md index 466b27589..be4bb69e6 100644 --- a/src/sdk-reference/cpp/1/collection/get-mapping/index.md +++ b/src/sdk-reference/cpp/1/collection/get-mapping/index.md @@ -37,7 +37,7 @@ Additional query options ## Return -A JSON string representing the collection data mapping. +A JSON string representing the collection mapping. ## Usage diff --git a/src/sdk-reference/cpp/1/collection/get-mapping/snippets/get-mapping.cpp b/src/sdk-reference/cpp/1/collection/get-mapping/snippets/get-mapping.cpp index 174a6de29..676d19505 100644 --- a/src/sdk-reference/cpp/1/collection/get-mapping/snippets/get-mapping.cpp +++ b/src/sdk-reference/cpp/1/collection/get-mapping/snippets/get-mapping.cpp @@ -2,7 +2,7 @@ try { std::string mapping = kuzzle->collection->getMapping("nyc-open-data", "yellow-taxi"); std::cout << mapping << std::endl; - // {"properties":{"license":{"type":"keyword"},"driver":{"properties":{"name":{"type":"keyword"},"curriculum":{"type":"text"}}}}} + // {"dynamic": "false","_meta": { "area": "Panipokhari" }, "properties":{"license":{"type":"keyword"},"driver":{"properties":{"name":{"type":"keyword"},"curriculum":{"type":"text"}}}}} } catch (kuzzleio::KuzzleException &e) { std::cerr << e.what() << std::endl; } diff --git a/src/sdk-reference/cpp/1/collection/update-mapping/index.md b/src/sdk-reference/cpp/1/collection/update-mapping/index.md index fbe3237c0..c08d3388a 100644 --- a/src/sdk-reference/cpp/1/collection/update-mapping/index.md +++ b/src/sdk-reference/cpp/1/collection/update-mapping/index.md @@ -6,9 +6,13 @@ description: Update the collection mapping # updateMapping -Update the collection mapping. -Mapping allow you to exploit the full capabilities of our -persistent data storage layer, [ElasticSearch](https://www.elastic.co/products/elasticsearch) (check here the [mapping capabilities of ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping.html)). +Updates a collection mapping. + +{{{since Kuzzle "1.7.1"}}} + +You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. + +You can define [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) within the `_meta` root field. ## Signature @@ -31,16 +35,19 @@ void updateMapping( |--------------|---------|-------------| | `index` |
const std::string&
| Index name | | `collection` |
const std::string&
| Collection name | -| `mapping` |
const std::string*
| JSON string representing the collection data mapping | +| `mapping` |
const std::string*
| JSON string representing the collection mapping | | `options` |
kuzzleio::query_options\*
| Query options | ### mapping -A JSON string representing the collection data mapping. +A JSON string representing the collection mapping. -The mapping must have a root field `properties` that contain the mapping definition: ```json { + "dynamic": "false", + "_meta": { + "field": "value" + }, "properties": { "field1": { "type": "text" }, "field2": { @@ -52,7 +59,8 @@ The mapping must have a root field `properties` that contain the mapping definit } ``` -You can see the full list of Elasticsearch mapping types [here](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping.html). +More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings. + ### options diff --git a/src/sdk-reference/cpp/1/collection/update-mapping/snippets/update-mapping.cpp b/src/sdk-reference/cpp/1/collection/update-mapping/snippets/update-mapping.cpp index 6ed441c28..705382a43 100644 --- a/src/sdk-reference/cpp/1/collection/update-mapping/snippets/update-mapping.cpp +++ b/src/sdk-reference/cpp/1/collection/update-mapping/snippets/update-mapping.cpp @@ -1,5 +1,9 @@ try { std::string mapping = R"({ + "dynamic": "false", + "_meta": { + "area": "Panipokhari" + }, "properties": { "plate": { "type": "keyword" } } diff --git a/src/sdk-reference/go/1/collection/create/index.md b/src/sdk-reference/go/1/collection/create/index.md index d98687d2b..4ed447a64 100644 --- a/src/sdk-reference/go/1/collection/create/index.md +++ b/src/sdk-reference/go/1/collection/create/index.md @@ -39,7 +39,7 @@ Create(index string, collection string, mapping json.RawMessage, options types.Q ### mapping -An string containing the JSON representation of the collection data mapping. +A `json.RawMessage` containing the representation of the collection mapping. ```json { @@ -56,7 +56,6 @@ An string containing the JSON representation of the collection data mapping. } } } - ``` More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings diff --git a/src/sdk-reference/go/1/collection/update-mapping/index.md b/src/sdk-reference/go/1/collection/update-mapping/index.md index 35c6da474..e134b124d 100644 --- a/src/sdk-reference/go/1/collection/update-mapping/index.md +++ b/src/sdk-reference/go/1/collection/update-mapping/index.md @@ -6,9 +6,13 @@ description: Update the collection mapping # updateMapping -Update the collection mapping. -Mapping allow you to exploit the full capabilities of our -persistent data storage layer, [ElasticSearch](https://www.elastic.co/products/elasticsearch) (check here the [mapping capabilities of ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/mapping.html)). +Updates a collection mapping. + +{{{since Kuzzle "1.7.1"}}} + +You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. + +You can define [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) within the `_meta` root field. ## Signature @@ -22,16 +26,19 @@ UpdateMapping(index string, collection string, mapping json.RawMessage, options |--------------|---------|-------------|---------- | ``index`` | string | Index name | yes | | ``collection`` | string | Collection name | yes | -| ``mapping`` | json.RawMessage | Collection data mapping in JSON format | yes | +| ``mapping`` | json.RawMessage | Collection mapping in JSON format | yes | | `options` | QueryOptions | Query options | no | -### **mapping** +### mapping -An string containing the JSON representation of the collection data mapping. +A `json.RawMessage` containing the representation of the collection mapping. -The mapping must have a root field `properties` that contain the mapping definition: ```json { + "dynamic": "false", + "_meta": { + "field": "value" + }, "properties": { "field1": { "type": "text" }, "field2": { @@ -43,9 +50,9 @@ The mapping must have a root field `properties` that contain the mapping definit } ``` -You can see the full list of Elasticsearch mapping types [here](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/mapping.html). +More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings -### **options** +### options Additional query options diff --git a/src/sdk-reference/go/1/collection/update-mapping/snippets/update-mapping.go b/src/sdk-reference/go/1/collection/update-mapping/snippets/update-mapping.go index fe0dfa683..d701033b2 100644 --- a/src/sdk-reference/go/1/collection/update-mapping/snippets/update-mapping.go +++ b/src/sdk-reference/go/1/collection/update-mapping/snippets/update-mapping.go @@ -1,4 +1,4 @@ -mapping := json.RawMessage(`{"properties":{"plate": {"type": "keyword"}}}`) +mapping := json.RawMessage(`{ "dynamic": "false","_meta": { "area": "Panipokhari" }, "properties":{"plate": {"type": "keyword"}}}`) err := kuzzle.Collection.UpdateMapping("nyc-open-data", "yellow-taxi", mapping, nil) if err != nil { diff --git a/src/sdk-reference/js/6/collection/get-mapping/index.md b/src/sdk-reference/js/6/collection/get-mapping/index.md index ecfe826db..c43769c6d 100644 --- a/src/sdk-reference/js/6/collection/get-mapping/index.md +++ b/src/sdk-reference/js/6/collection/get-mapping/index.md @@ -6,7 +6,7 @@ description: Return collection mapping # getMapping -Returns a data collection mapping. +Returns the collection mapping.
diff --git a/src/sdk-reference/js/6/collection/get-mapping/snippets/get-mapping.js b/src/sdk-reference/js/6/collection/get-mapping/snippets/get-mapping.js index 0505683f1..db4b0875a 100644 --- a/src/sdk-reference/js/6/collection/get-mapping/snippets/get-mapping.js +++ b/src/sdk-reference/js/6/collection/get-mapping/snippets/get-mapping.js @@ -3,6 +3,10 @@ try { console.log(mapping); /* { + dynamic: 'false', + _meta: { + area: 'Panipokhari + }, properties: { license: { type: 'keyword' }, driver: { diff --git a/src/sdk-reference/js/6/collection/update-mapping/index.md b/src/sdk-reference/js/6/collection/update-mapping/index.md index 1a8779a40..ae09a6f7c 100644 --- a/src/sdk-reference/js/6/collection/update-mapping/index.md +++ b/src/sdk-reference/js/6/collection/update-mapping/index.md @@ -6,7 +6,13 @@ description: Update the collection mapping # updateMapping -Updates a data collection mapping. +Updates a collection mapping. + +{{{since Kuzzle "1.7.1"}}} + +You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. + +You can define [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) within the `_meta` root field.
@@ -20,28 +26,31 @@ updateMapping (index, collection, mapping, [options]) |--------------|---------|-------------| | ``index`` |
string
| Index name | | ``collection`` |
string
| Collection name | -| ``mapping`` |
object
| Describes the data mapping to associate to the new collection, using Elasticsearch [mapping format](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping.html) | +| ``mapping`` |
object
| Describes the collection mapping | | ``options`` |
object
| Query options | ### mapping -An object representing the collection data mapping. +An object representing the data mapping of the collection. -This object must have a root field `properties` that contain the mapping definition: -```javascript +```js const mapping = { + dynamic: 'false', + _meta: { + field: 'value' + }, properties: { field1: { type: 'text' }, field2: { properties: { - nestedField: { type: 'keyword' } + nestedField: { type: 'keyword'} } } } }; ``` -You can see the full list of Elasticsearch mapping types [here](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping-types.html). +More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings ### options diff --git a/src/sdk-reference/js/6/collection/update-mapping/snippets/update-mapping.js b/src/sdk-reference/js/6/collection/update-mapping/snippets/update-mapping.js index 0f37af87f..d286a6c0a 100644 --- a/src/sdk-reference/js/6/collection/update-mapping/snippets/update-mapping.js +++ b/src/sdk-reference/js/6/collection/update-mapping/snippets/update-mapping.js @@ -1,4 +1,8 @@ const mapping = { + dynamic: 'false', + _meta: { + area: 'Panipokhari' + }, properties: { plate: { type: 'keyword' } } From 7a5bace2300ac31cf55fe9c85735b45c6fb4ede0 Mon Sep 17 00:00:00 2001 From: Aschen Date: Wed, 27 Mar 2019 08:33:42 +0100 Subject: [PATCH 5/8] Fix since tag --- helpers/handlebars.js | 5 ++--- src/guide/1/essentials/database-mappings/index.md | 12 ++++++------ src/sdk-reference/cpp/1/collection/create/index.md | 4 ++-- .../cpp/1/collection/update-mapping/index.md | 2 +- src/sdk-reference/go/1/collection/create/index.md | 4 ++-- .../go/1/collection/update-mapping/index.md | 2 +- src/sdk-reference/js/6/collection/create/index.md | 4 ++-- .../js/6/collection/update-mapping/index.md | 2 +- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/helpers/handlebars.js b/helpers/handlebars.js index 659eeb2e7..8d999067c 100644 --- a/helpers/handlebars.js +++ b/helpers/handlebars.js @@ -66,8 +66,7 @@ module.exports = { return new SafeString(title); }, - since: version => `

Added in v${version}

`, + since: version => `

Added in ${version}

`, - deprecated: version => `

Deprecated since v${version}

` + deprecated: version => `

Deprecated since ${version}

` }; - diff --git a/src/guide/1/essentials/database-mappings/index.md b/src/guide/1/essentials/database-mappings/index.md index de4361051..eefee7b18 100644 --- a/src/guide/1/essentials/database-mappings/index.md +++ b/src/guide/1/essentials/database-mappings/index.md @@ -6,12 +6,12 @@ order: 400 # Database mappings -With Elasticsearch, it is possible to define mappings for collections. These mappings allow you to configure the way Elasticsearch will handle these collections. +With Elasticsearch, it is possible to define mappings for collections. These mappings allows you to configure the way Elasticsearch will handle these collections. There are 3 root fields for mapping configuration: - - `dynamic`: dynamic mapping policy against new fields - - `_meta`: collection metadata - - `properties`: collection types definition + - [properties]({{ site_base_path}}guide/1/essentials/database-mappings/#properties-types-definition): collection types definition + - [dynamic]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy): dynamic mapping policy against new fields + - [_meta]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata): collection metadata The following API methods can be used to modify these mappings: - [collection:create]({{ site_base_path }}api/1/controller-collection/create/) @@ -23,7 +23,7 @@ The following API methods can be used to modify these mappings: The definition of the types of fields that will be inserted in a collection allows Elasticsearch to optimize the indexing of your data for future searches. -Especially when searching on special fields such as `date` or `geo_shape` types. +Especially when searching on fields with special types such as `date` or `geo_shape`.
Once a type has been defined for a field, it is not possible to modify it later. @@ -113,7 +113,7 @@ If you want a `strict` dynamic policy for your entire collection, you have to de "properties": { "driver": { "dynamic": "false" - "properties": // allow insertion of new fields in the driver + "properties": // allow insertion of new fields in the driver nested field } } } diff --git a/src/sdk-reference/cpp/1/collection/create/index.md b/src/sdk-reference/cpp/1/collection/create/index.md index 783054da7..04af41aeb 100644 --- a/src/sdk-reference/cpp/1/collection/create/index.md +++ b/src/sdk-reference/cpp/1/collection/create/index.md @@ -8,13 +8,13 @@ description: Create a new collection Creates a new [collection]({{ site_base_path }}guide/1/essentials/persisted) in Kuzzle via the persistence engine, in the provided index. -{{{since Kuzzle "1.3.0"}}} +{{{since "Kuzzle 1.3.0"}}} You can also provide an optional body with a [collection mapping]({{ site_base_path }}guide/1/essentials/database-mappings) that allow you to exploit the full capabilities of our persistent data storage layer. This method will only update the mapping when the collection already exists. -{{{since Kuzzle "1.7.1"}}} +{{{since "Kuzzle 1.7.1"}}} You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. diff --git a/src/sdk-reference/cpp/1/collection/update-mapping/index.md b/src/sdk-reference/cpp/1/collection/update-mapping/index.md index c08d3388a..dbb851e32 100644 --- a/src/sdk-reference/cpp/1/collection/update-mapping/index.md +++ b/src/sdk-reference/cpp/1/collection/update-mapping/index.md @@ -8,7 +8,7 @@ description: Update the collection mapping Updates a collection mapping. -{{{since Kuzzle "1.7.1"}}} +{{{since "Kuzzle 1.7.1"}}} You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. diff --git a/src/sdk-reference/go/1/collection/create/index.md b/src/sdk-reference/go/1/collection/create/index.md index 4ed447a64..40fe22e6e 100644 --- a/src/sdk-reference/go/1/collection/create/index.md +++ b/src/sdk-reference/go/1/collection/create/index.md @@ -8,13 +8,13 @@ description: Create a new collection Creates a new [collection]({{ site_base_path }}guide/1/essentials/persisted) in Kuzzle via the persistence engine, in the provided index. -{{{since Kuzzle "1.3.0"}}} +{{{since "Kuzzle 1.3.0"}}} You can also provide an optional body with a [collection mapping]({{ site_base_path }}guide/1/essentials/database-mappings) that allow you to exploit the full capabilities of our persistent data storage layer. This method will only update the mapping when the collection already exists. -{{{since Kuzzle "1.7.1"}}} +{{{since "Kuzzle 1.7.1"}}} You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. diff --git a/src/sdk-reference/go/1/collection/update-mapping/index.md b/src/sdk-reference/go/1/collection/update-mapping/index.md index e134b124d..6ca982e94 100644 --- a/src/sdk-reference/go/1/collection/update-mapping/index.md +++ b/src/sdk-reference/go/1/collection/update-mapping/index.md @@ -8,7 +8,7 @@ description: Update the collection mapping Updates a collection mapping. -{{{since Kuzzle "1.7.1"}}} +{{{since "Kuzzle 1.7.1"}}} You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. diff --git a/src/sdk-reference/js/6/collection/create/index.md b/src/sdk-reference/js/6/collection/create/index.md index 824ff0a7f..e6625c50d 100644 --- a/src/sdk-reference/js/6/collection/create/index.md +++ b/src/sdk-reference/js/6/collection/create/index.md @@ -8,13 +8,13 @@ description: Create a new collection Creates a new [collection]({{ site_base_path }}guide/1/essentials/persisted) in Kuzzle via the persistence engine, in the provided index. -{{{since Kuzzle "1.3.0"}}} +{{{since "Kuzzle 1.3.0"}}} You can also provide an optional body with a [collection mapping]({{ site_base_path }}guide/1/essentials/database-mappings) that allow you to exploit the full capabilities of our persistent data storage layer. This method will only update the mapping when the collection already exists. -{{{since Kuzzle "1.7.1"}}} +{{{since "Kuzzle 1.7.1"}}} You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. diff --git a/src/sdk-reference/js/6/collection/update-mapping/index.md b/src/sdk-reference/js/6/collection/update-mapping/index.md index ae09a6f7c..e4f47a14b 100644 --- a/src/sdk-reference/js/6/collection/update-mapping/index.md +++ b/src/sdk-reference/js/6/collection/update-mapping/index.md @@ -8,7 +8,7 @@ description: Update the collection mapping Updates a collection mapping. -{{{since Kuzzle "1.7.1"}}} +{{{since "Kuzzle 1.7.1"}}} You can define the collection [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value. From 65d41860c28b88330d44a5121376fa21767d3f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Cottinet?= Date: Wed, 27 Mar 2019 11:54:06 +0100 Subject: [PATCH 6/8] Apply suggestions from @scottinet Co-Authored-By: Aschen --- src/api/1/controller-collection/create/index.md | 8 ++++---- src/api/1/controller-collection/update-mapping/index.md | 6 +++--- src/guide/1/essentials/database-mappings/index.md | 6 +++--- src/sdk-reference/cpp/1/collection/create/index.md | 4 ++-- .../cpp/1/collection/update-mapping/index.md | 4 ++-- src/sdk-reference/go/1/collection/create/index.md | 4 ++-- src/sdk-reference/go/1/collection/update-mapping/index.md | 4 ++-- src/sdk-reference/js/6/collection/create/index.md | 4 ++-- src/sdk-reference/js/6/collection/update-mapping/index.md | 4 ++-- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/api/1/controller-collection/create/index.md b/src/api/1/controller-collection/create/index.md index 8edbf5dbc..86cfb6ac3 100644 --- a/src/api/1/controller-collection/create/index.md +++ b/src/api/1/controller-collection/create/index.md @@ -11,7 +11,7 @@ Creates a new [collection]({{ site_base_path }}guide/1/essentials/persisted), in {{{since "1.3.0"}}} -You can also provide an optional body with a [collection mapping]({{ site_base_path }}guide/1/essentials/database-mappings) that allow you to exploit the full capabilities of our persistent data storage layer. +You can also provide an optional body with a [collection mapping]({{ site_base_path }}guide/1/essentials/database-mappings) allowing you to exploit the full capabilities of our persistent data storage layer. This method will only update the mapping when the collection already exists. @@ -35,7 +35,7 @@ Body: ```js { - "dynamic": "false", + "dynamic": "[false|true|strict]", "_meta": { "field": "value" }, @@ -64,7 +64,7 @@ Body: "controller": "collection", "action": "create", "body": { - "dynamic": "false", + "dynamic": "[false|true|strict]", "_meta": { "field": "value" }, @@ -97,7 +97,7 @@ Body: ### Optional: -* `dynamic`: [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) for new fields +* `dynamic`: [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) for new fields. Allowed values: `true` (default), `false`, `strict` * `_meta`: [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) stored next to the collection * `properties`: object describing the data mapping to associate to the new collection, using [Elasticsearch types definitions format]({{ site_base_path}}guide/1/essentials/database-mappings/#properties-types-definition) diff --git a/src/api/1/controller-collection/update-mapping/index.md b/src/api/1/controller-collection/update-mapping/index.md index 81499bf7e..3f2a46ebd 100644 --- a/src/api/1/controller-collection/update-mapping/index.md +++ b/src/api/1/controller-collection/update-mapping/index.md @@ -29,7 +29,7 @@ Body: ```js { - "dynamic": "false", + "dynamic": "[true|false|strict]", "_meta": { "field": "value" }, @@ -57,7 +57,7 @@ Body: "controller": "collection", "action": "updateMapping", "body": { - "dynamic": "false", + "dynamic": "[true|false|strict]", "_meta": { "field": "value" }, @@ -90,7 +90,7 @@ Body: ### Optional: -* `dynamic`: [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) for new fields +* `dynamic`: [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) for new fields. Allowed values: `true` (default), `false`, `strict` * `_meta`: [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) stored next to the collection * `properties`: object describing the data mapping to associate to the new collection, using [Elasticsearch types definitions format]({{ site_base_path}}guide/1/essentials/database-mappings/#properties-types-definition) diff --git a/src/guide/1/essentials/database-mappings/index.md b/src/guide/1/essentials/database-mappings/index.md index eefee7b18..fe01c37ee 100644 --- a/src/guide/1/essentials/database-mappings/index.md +++ b/src/guide/1/essentials/database-mappings/index.md @@ -6,7 +6,7 @@ order: 400 # Database mappings -With Elasticsearch, it is possible to define mappings for collections. These mappings allows you to configure the way Elasticsearch will handle these collections. +With Elasticsearch, it is possible to define mappings for collections. These mappings allow you to configure the way Elasticsearch will handle these collections. There are 3 root fields for mapping configuration: - [properties]({{ site_base_path}}guide/1/essentials/database-mappings/#properties-types-definition): collection types definition @@ -21,7 +21,7 @@ The following API methods can be used to modify these mappings: ## Properties types definition -The definition of the types of fields that will be inserted in a collection allows Elasticsearch to optimize the indexing of your data for future searches. +The field type definitions that will be inserted in a collection allow Elasticsearch to index your data for future searches. Especially when searching on fields with special types such as `date` or `geo_shape`. @@ -77,7 +77,7 @@ curl -X POST -d '{"category":"limousine","distance":120990,"position":{"lat":27.
Because of the way Elasticsearch manages collections, mappings are shared between indexes.
-This means that if I have an index nyc-open-data, two collections yellow-taxi and green-taxi and a field name with type keyword in the collection yellow-taxi, I couldn't have a field name with a different type in the collection green-taxi. +This means that if I have an index nyc-open-data, two collections yellow-taxi and green-taxi and a field name with type keyword in the collection yellow-taxi, then I can't have a field name with a different type in the collection green-taxi.
--- diff --git a/src/sdk-reference/cpp/1/collection/create/index.md b/src/sdk-reference/cpp/1/collection/create/index.md index 04af41aeb..4ea5ab955 100644 --- a/src/sdk-reference/cpp/1/collection/create/index.md +++ b/src/sdk-reference/cpp/1/collection/create/index.md @@ -57,7 +57,7 @@ A JSON string representing the collection mapping. ```json { - "dynamic": "false", + "dynamic": "[true|false|strict]", "_meta": { "field": "value" }, @@ -72,7 +72,7 @@ A JSON string representing the collection mapping. } ``` -More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings. +More information about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings. ### options diff --git a/src/sdk-reference/cpp/1/collection/update-mapping/index.md b/src/sdk-reference/cpp/1/collection/update-mapping/index.md index dbb851e32..fcd1b8e8d 100644 --- a/src/sdk-reference/cpp/1/collection/update-mapping/index.md +++ b/src/sdk-reference/cpp/1/collection/update-mapping/index.md @@ -44,7 +44,7 @@ A JSON string representing the collection mapping. ```json { - "dynamic": "false", + "dynamic": "[true|false|strict]", "_meta": { "field": "value" }, @@ -59,7 +59,7 @@ A JSON string representing the collection mapping. } ``` -More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings. +More information about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings. ### options diff --git a/src/sdk-reference/go/1/collection/create/index.md b/src/sdk-reference/go/1/collection/create/index.md index 40fe22e6e..a8fbac94c 100644 --- a/src/sdk-reference/go/1/collection/create/index.md +++ b/src/sdk-reference/go/1/collection/create/index.md @@ -43,7 +43,7 @@ A `json.RawMessage` containing the representation of the collection mapping. ```json { - "dynamic": "false", + "dynamic": "[true|false|strict]", "_meta": { "field": "value" }, @@ -58,7 +58,7 @@ A `json.RawMessage` containing the representation of the collection mapping. } ``` -More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings +More information about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings ### options diff --git a/src/sdk-reference/go/1/collection/update-mapping/index.md b/src/sdk-reference/go/1/collection/update-mapping/index.md index 6ca982e94..0d48c2fae 100644 --- a/src/sdk-reference/go/1/collection/update-mapping/index.md +++ b/src/sdk-reference/go/1/collection/update-mapping/index.md @@ -35,7 +35,7 @@ A `json.RawMessage` containing the representation of the collection mapping. ```json { - "dynamic": "false", + "dynamic": "[true|false|strict]", "_meta": { "field": "value" }, @@ -50,7 +50,7 @@ A `json.RawMessage` containing the representation of the collection mapping. } ``` -More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings +More information about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings ### options diff --git a/src/sdk-reference/js/6/collection/create/index.md b/src/sdk-reference/js/6/collection/create/index.md index e6625c50d..28a6c7ab6 100644 --- a/src/sdk-reference/js/6/collection/create/index.md +++ b/src/sdk-reference/js/6/collection/create/index.md @@ -41,7 +41,7 @@ An object representing the data mapping of the collection. ```js const mapping = { - dynamic: 'false', + dynamic: '[true|false|strict]', _meta: { field: 'value' }, @@ -56,7 +56,7 @@ const mapping = { }; ``` -More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings +More information about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings ### options diff --git a/src/sdk-reference/js/6/collection/update-mapping/index.md b/src/sdk-reference/js/6/collection/update-mapping/index.md index e4f47a14b..8b561e491 100644 --- a/src/sdk-reference/js/6/collection/update-mapping/index.md +++ b/src/sdk-reference/js/6/collection/update-mapping/index.md @@ -35,7 +35,7 @@ An object representing the data mapping of the collection. ```js const mapping = { - dynamic: 'false', + dynamic: '[true|false|strict]', _meta: { field: 'value' }, @@ -50,7 +50,7 @@ const mapping = { }; ``` -More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings +More information about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings ### options From d643de5e22f37eb510de3b863fbe62645d3174c1 Mon Sep 17 00:00:00 2001 From: Aschen Date: Fri, 29 Mar 2019 08:22:31 +0100 Subject: [PATCH 7/8] dead link + warning about _meta --- src/guide/1/essentials/database-mappings/index.md | 8 +++++++- src/sdk-reference/cpp/1/collection/create/index.md | 2 +- .../cpp/1/collection/update-mapping/index.md | 2 +- src/sdk-reference/go/1/collection/create/index.md | 2 +- src/sdk-reference/go/1/collection/update-mapping/index.md | 2 +- src/sdk-reference/js/6/collection/create/index.md | 2 +- src/sdk-reference/js/6/collection/update-mapping/index.md | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/guide/1/essentials/database-mappings/index.md b/src/guide/1/essentials/database-mappings/index.md index eefee7b18..1ad4710a8 100644 --- a/src/guide/1/essentials/database-mappings/index.md +++ b/src/guide/1/essentials/database-mappings/index.md @@ -4,7 +4,7 @@ title: Define database mapping order: 400 --- -# Database mappings +# Database mappings for collections With Elasticsearch, it is possible to define mappings for collections. These mappings allows you to configure the way Elasticsearch will handle these collections. @@ -137,6 +137,12 @@ curl -X POST -d '{"language":"nepali"}' -H "Content-Type: application/json" "htt Elasticsearch allows the definition of metadata that is stored next to the collections in the root field `_meta`. These metadata are ignored by Elasticsearch, they can contain any type of information specific to your application. +
+Unlike the properties types definition, new collection metadata are not merged with the old one. +
+If you set the _meta field in your request, the old value will be overwritten. +
+ Refer to Elasticsearch documentation for more informations: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/mapping-meta-field.html These metadata can be retrieved with the [collection:getMapping]({{ site_base_path }}api/1/controller-collection/get-mapping/) API method. diff --git a/src/sdk-reference/cpp/1/collection/create/index.md b/src/sdk-reference/cpp/1/collection/create/index.md index 04af41aeb..87daab060 100644 --- a/src/sdk-reference/cpp/1/collection/create/index.md +++ b/src/sdk-reference/cpp/1/collection/create/index.md @@ -72,7 +72,7 @@ A JSON string representing the collection mapping. } ``` -More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings. +More informations about collection mapping [here]({{ site_base_path}}guide/1/essentials/database-mappings). ### options diff --git a/src/sdk-reference/cpp/1/collection/update-mapping/index.md b/src/sdk-reference/cpp/1/collection/update-mapping/index.md index dbb851e32..fc1479210 100644 --- a/src/sdk-reference/cpp/1/collection/update-mapping/index.md +++ b/src/sdk-reference/cpp/1/collection/update-mapping/index.md @@ -59,7 +59,7 @@ A JSON string representing the collection mapping. } ``` -More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings. +More informations about collection mapping [here]({{ site_base_path}}guide/1/essentials/database-mappings). ### options diff --git a/src/sdk-reference/go/1/collection/create/index.md b/src/sdk-reference/go/1/collection/create/index.md index 40fe22e6e..88fab32b0 100644 --- a/src/sdk-reference/go/1/collection/create/index.md +++ b/src/sdk-reference/go/1/collection/create/index.md @@ -58,7 +58,7 @@ A `json.RawMessage` containing the representation of the collection mapping. } ``` -More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings +More informations about collection mapping [here]({{ site_base_path}}guide/1/essentials/database-mappings) ### options diff --git a/src/sdk-reference/go/1/collection/update-mapping/index.md b/src/sdk-reference/go/1/collection/update-mapping/index.md index 6ca982e94..6f554a1a4 100644 --- a/src/sdk-reference/go/1/collection/update-mapping/index.md +++ b/src/sdk-reference/go/1/collection/update-mapping/index.md @@ -50,7 +50,7 @@ A `json.RawMessage` containing the representation of the collection mapping. } ``` -More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings +More informations about collection mapping [here]({{ site_base_path}}guide/1/essentials/database-mappings) ### options diff --git a/src/sdk-reference/js/6/collection/create/index.md b/src/sdk-reference/js/6/collection/create/index.md index e6625c50d..8c6b7c2c2 100644 --- a/src/sdk-reference/js/6/collection/create/index.md +++ b/src/sdk-reference/js/6/collection/create/index.md @@ -56,7 +56,7 @@ const mapping = { }; ``` -More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings +More informations about collection mapping [here]({{ site_base_path}}guide/1/essentials/database-mappings) ### options diff --git a/src/sdk-reference/js/6/collection/update-mapping/index.md b/src/sdk-reference/js/6/collection/update-mapping/index.md index e4f47a14b..c5ffbbff3 100644 --- a/src/sdk-reference/js/6/collection/update-mapping/index.md +++ b/src/sdk-reference/js/6/collection/update-mapping/index.md @@ -50,7 +50,7 @@ const mapping = { }; ``` -More informations about collection mapping: {{ site_base_path}}guide/1/essentials/database-mappings +More informations about collection mapping [here]({{ site_base_path}}guide/1/essentials/database-mappings) ### options From e15e30730dd7529a57d473858ebfdea960adea10 Mon Sep 17 00:00:00 2001 From: Aschen Date: Fri, 29 Mar 2019 08:27:42 +0100 Subject: [PATCH 8/8] collection mapping => database mapping --- src/guide/1/essentials/database-mappings/index.md | 4 ++-- src/sdk-reference/cpp/1/collection/create/index.md | 2 +- src/sdk-reference/cpp/1/collection/update-mapping/index.md | 2 +- src/sdk-reference/go/1/collection/create/index.md | 2 +- src/sdk-reference/go/1/collection/update-mapping/index.md | 2 +- src/sdk-reference/js/6/collection/create/index.md | 2 +- src/sdk-reference/js/6/collection/update-mapping/index.md | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/guide/1/essentials/database-mappings/index.md b/src/guide/1/essentials/database-mappings/index.md index cd2eeda19..222445655 100644 --- a/src/guide/1/essentials/database-mappings/index.md +++ b/src/guide/1/essentials/database-mappings/index.md @@ -1,10 +1,10 @@ --- layout: full.html.hbs -title: Define database mapping +title: Define database mappings order: 400 --- -# Database mappings for collections +# Database mappings With Elasticsearch, it is possible to define mappings for collections. These mappings allow you to configure the way Elasticsearch will handle these collections. diff --git a/src/sdk-reference/cpp/1/collection/create/index.md b/src/sdk-reference/cpp/1/collection/create/index.md index ecac00fbe..4ea4b9460 100644 --- a/src/sdk-reference/cpp/1/collection/create/index.md +++ b/src/sdk-reference/cpp/1/collection/create/index.md @@ -72,7 +72,7 @@ A JSON string representing the collection mapping. } ``` -More informations about collection mapping [here]({{ site_base_path}}guide/1/essentials/database-mappings). +More informations about database mappings [here]({{ site_base_path}}guide/1/essentials/database-mappings). ### options diff --git a/src/sdk-reference/cpp/1/collection/update-mapping/index.md b/src/sdk-reference/cpp/1/collection/update-mapping/index.md index 963bb28eb..9be9d9149 100644 --- a/src/sdk-reference/cpp/1/collection/update-mapping/index.md +++ b/src/sdk-reference/cpp/1/collection/update-mapping/index.md @@ -59,7 +59,7 @@ A JSON string representing the collection mapping. } ``` -More informations about collection mapping [here]({{ site_base_path}}guide/1/essentials/database-mappings). +More informations about database mappings [here]({{ site_base_path}}guide/1/essentials/database-mappings). ### options diff --git a/src/sdk-reference/go/1/collection/create/index.md b/src/sdk-reference/go/1/collection/create/index.md index a3cc5a19e..c12cb9ecd 100644 --- a/src/sdk-reference/go/1/collection/create/index.md +++ b/src/sdk-reference/go/1/collection/create/index.md @@ -58,7 +58,7 @@ A `json.RawMessage` containing the representation of the collection mapping. } ``` -More informations about collection mapping [here]({{ site_base_path}}guide/1/essentials/database-mappings) +More informations about database mappings [here]({{ site_base_path}}guide/1/essentials/database-mappings) ### options diff --git a/src/sdk-reference/go/1/collection/update-mapping/index.md b/src/sdk-reference/go/1/collection/update-mapping/index.md index 2363c3aa0..9783ce623 100644 --- a/src/sdk-reference/go/1/collection/update-mapping/index.md +++ b/src/sdk-reference/go/1/collection/update-mapping/index.md @@ -50,7 +50,7 @@ A `json.RawMessage` containing the representation of the collection mapping. } ``` -More informations about collection mapping [here]({{ site_base_path}}guide/1/essentials/database-mappings) +More informations about database mappings [here]({{ site_base_path}}guide/1/essentials/database-mappings) ### options diff --git a/src/sdk-reference/js/6/collection/create/index.md b/src/sdk-reference/js/6/collection/create/index.md index 3699e76e2..d516649fd 100644 --- a/src/sdk-reference/js/6/collection/create/index.md +++ b/src/sdk-reference/js/6/collection/create/index.md @@ -56,7 +56,7 @@ const mapping = { }; ``` -More informations about collection mapping [here]({{ site_base_path}}guide/1/essentials/database-mappings) +More informations about database mappings [here]({{ site_base_path}}guide/1/essentials/database-mappings) ### options diff --git a/src/sdk-reference/js/6/collection/update-mapping/index.md b/src/sdk-reference/js/6/collection/update-mapping/index.md index 4d877c07d..ee604b643 100644 --- a/src/sdk-reference/js/6/collection/update-mapping/index.md +++ b/src/sdk-reference/js/6/collection/update-mapping/index.md @@ -50,7 +50,7 @@ const mapping = { }; ``` -More informations about collection mapping [here]({{ site_base_path}}guide/1/essentials/database-mappings) +More informations about database mappings [here]({{ site_base_path}}guide/1/essentials/database-mappings) ### options