Skip to content

Commit d0100f5

Browse files
kuzzlealexandrebouthinon
authored andcommitted
Release 2.1.1 (#289)
* Add documentation page about mappings (#271) Adds a documentation essentials page about mappings: dynamic mapping policy collection metadata properties types definitions Also update SDKs See kuzzleio/kuzzle#1257 * Embedded protocols (#286) Documentation for embedded protocols, notably for MQTT. * Extending the JS SDK with controllers (#284) Add a page about how to extend the JS SDK with custom controllers. https://deploy-preview-284--kuzzle-doc-v2.netlify.com/sdk-reference/js/6/extend-sdk/ Also document: - BaseController class - Kuzzle.useController method See kuzzleio/sdk-javascript#388 * [KZL-907] Getting started dev plugin (#276) ## What does this PR do? This PR responds to this [ticket](https://jira.kaliop.net/browse/KZL-907). Also, it increases the readability of documentation's plugin part. ### How should this be manually tested? [Netify](https://deploy-preview-276--kuzzle-doc-v2.netlify.com/plugins/1/essentials/introduction/) ### Other changes - Re-arrange plugin documentation path - Update dead link in boilerplate repository ### Boyscout Prettier * Release 2.1.1
1 parent fca740c commit d0100f5

File tree

71 files changed

+1647
-775
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1647
-775
lines changed

helpers/handlebars.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ module.exports = {
6666
return new SafeString(title);
6767
},
6868

69-
since: version => `<p class="since">Added in v${version}</p>`,
69+
since: version => `<p class="since">Added in ${version}</p>`,
7070

71-
deprecated: version => `<p class="deprecated">Deprecated since v${version}</p>`
71+
deprecated: version => `<p class="deprecated">Deprecated since ${version}</p>`
7272
};
73-

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kuzzleio-documentation",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "Kuzzle Documentation",
55
"main": "index.js",
66
"scripts": {

src/api/1/controller-collection/create/index.md

+25-9
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ Creates a new [collection]({{ site_base_path }}guide/1/essentials/persisted), in
1111

1212
{{{since "1.3.0"}}}
1313

14-
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.
14+
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.
1515

16-
This method will only update the mapping if the collection already exists.
16+
This method will only update the mapping when the collection already exists.
17+
18+
{{{since "1.7.1"}}}
19+
20+
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.
21+
22+
You can define [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) within the `_meta` root field.
1723

1824
---
1925

@@ -29,6 +35,10 @@ Body:
2935

3036
```js
3137
{
38+
"dynamic": "[false|true|strict]",
39+
"_meta": {
40+
"field": "value"
41+
},
3242
"properties": {
3343
"field1": {
3444
"type": "integer"
@@ -37,8 +47,8 @@ Body:
3747
"type": "keyword"
3848
},
3949
"field3": {
40-
"type": "date",
41-
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
50+
"type": "date",
51+
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
4252
}
4353
}
4454
}
@@ -54,6 +64,10 @@ Body:
5464
"controller": "collection",
5565
"action": "create",
5666
"body": {
67+
"dynamic": "[false|true|strict]",
68+
"_meta": {
69+
"field": "value"
70+
},
5771
"properties": {
5872
"field1": {
5973
"type": "integer"
@@ -62,8 +76,8 @@ Body:
6276
"type": "keyword"
6377
},
6478
"field3": {
65-
"type": "date",
66-
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
79+
"type": "date",
80+
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
6781
}
6882
}
6983
}
@@ -74,16 +88,18 @@ Body:
7488

7589
## Arguments
7690

77-
* `collection`: collection name to create
78-
* `index`: index name that will host the new collection
91+
* `collection`: name of the collection to create
92+
* `index`: index that will host the new collection
7993

8094
---
8195

8296
## Body properties
8397

8498
### Optional:
8599

86-
* `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).
100+
* `dynamic`: [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) for new fields. Allowed values: `true` (default), `false`, `strict`
101+
* `_meta`: [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) stored next to the collection
102+
* `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)
87103

88104
---
89105

src/api/1/controller-collection/get-mapping/index.md

+24-16
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ title: getMapping
77

88
{{{since "1.0.0"}}}
99

10-
Returns a collection mapping.
10+
Returns the collection mapping.
11+
12+
{{{since "1.7.1"}}}
13+
14+
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).
1115

1216
---
1317

@@ -47,13 +51,17 @@ Returns a mapping object with the following structure:
4751

4852
```
4953
<index>
50-
|- mappings
51-
|- <collection>
52-
|- properties
53-
|- mapping for field 1
54-
|- mapping for field 2
55-
|- ...
56-
|- mapping for field n
54+
|- mappings
55+
|- <collection>
56+
|- dynamic
57+
|- _meta
58+
|- metadata 1
59+
|- metadata 1
60+
|- properties
61+
|- mapping for field 1
62+
|- mapping for field 2
63+
|- ...
64+
|- mapping for field n
5765
```
5866

5967
### Example:
@@ -71,16 +79,16 @@ Returns a mapping object with the following structure:
7179
"<index>": {
7280
"mappings": {
7381
"<collection>": {
82+
"dynamic": "true",
83+
"_meta": {
84+
"metadata1": "value1"
85+
},
7486
"properties": {
75-
"field1": {
76-
"type": "integer"
77-
},
78-
"field2": {
79-
"type": "keyword"
80-
},
87+
"field1": { "type": "integer" },
88+
"field2": { "type": "keyword" },
8189
"field3": {
82-
"type": "date",
83-
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
90+
"type": "date",
91+
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
8492
}
8593
}
8694
}

src/api/1/controller-collection/update-mapping/index.md

+25-8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ title: updateMapping
99

1010
Updates a collection mapping.
1111

12+
{{{since "1.7.1"}}}
13+
14+
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.
15+
16+
You can define [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) within the `_meta` root field.
17+
1218
---
1319

1420
## Query Syntax
@@ -23,6 +29,10 @@ Body:
2329

2430
```js
2531
{
32+
"dynamic": "[true|false|strict]",
33+
"_meta": {
34+
"field": "value"
35+
},
2636
"properties": {
2737
"field1": {
2838
"type": "integer"
@@ -31,8 +41,8 @@ Body:
3141
"type": "keyword"
3242
},
3343
"field3": {
34-
"type": "date",
35-
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
44+
"type": "date",
45+
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
3646
}
3747
}
3848
}
@@ -46,8 +56,11 @@ Body:
4656
"collection": "<collection>",
4757
"controller": "collection",
4858
"action": "updateMapping",
49-
5059
"body": {
60+
"dynamic": "[true|false|strict]",
61+
"_meta": {
62+
"field": "value"
63+
},
5164
"properties": {
5265
"field1": {
5366
"type": "integer"
@@ -56,8 +69,8 @@ Body:
5669
"type": "keyword"
5770
},
5871
"field3": {
59-
"type": "date",
60-
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
72+
"type": "date",
73+
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
6174
}
6275
}
6376
}
@@ -68,14 +81,18 @@ Body:
6881

6982
## Arguments
7083

71-
* `collection`: collection name
72-
* `index`: index name
84+
* `collection`: name of the collection to update
85+
* `index`: index that will host the new collection
7386

7487
---
7588

7689
## Body properties
7790

78-
* `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).
91+
### Optional:
92+
93+
* `dynamic`: [dynamic mapping policy]({{ site_base_path}}guide/1/essentials/database-mappings/#dynamic-mapping-policy) for new fields. Allowed values: `true` (default), `false`, `strict`
94+
* `_meta`: [collection additional metadata]({{ site_base_path}}guide/1/essentials/database-mappings/#collection-metadata) stored next to the collection
95+
* `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)
7996

8097
---
8198

0 commit comments

Comments
 (0)