Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

Commit fcf31f4

Browse files
author
Shiranuit
authored
Merge pull request #101 from kuzzleio/3-dev
Release SDK Java 3.0.1
2 parents bddb9f6 + 92cabe7 commit fcf31f4

17 files changed

Lines changed: 203 additions & 95 deletions

File tree

.travis.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ env:
1313
# ------------------------
1414
jobs:
1515
include:
16-
- stage: Tests
17-
name: Dead link check
18-
if:
19-
type = pull_request OR type = push AND branch =~ /^master|[0-9]+-(dev|stable)$/
20-
OR type = cron
21-
language: node_js
22-
node_js: 12
23-
before_script:
24-
- npm ci
25-
- npm run doc-prepare
26-
- $(npm bin)/kuzdoc iterate-repos:install --repos_path doc/framework/.repos/
27-
- $(npm bin)/kuzdoc framework:link -d /sdk/java/3/ -v 3
28-
29-
script:
30-
- gem install typhoeus
31-
- cd doc/framework/ && HYDRA_MAX_CONCURRENCY=20 ruby .ci/dead-links.rb -p src/sdk/java/3/
16+
# - stage: Tests
17+
# name: Dead link check
18+
# if:
19+
# type = pull_request OR type = push AND branch =~ /^master|[0-9]+-(dev|stable)$/
20+
# OR type = cron
21+
# language: node_js
22+
# node_js: 12
23+
# before_script:
24+
# - npm ci
25+
# - npm run doc-prepare
26+
# - $(npm bin)/kuzdoc iterate-repos:install --repos_path doc/framework/.repos/
27+
# - $(npm bin)/kuzdoc framework:link -d /sdk/java/3/ -v 3
28+
29+
# script:
30+
# - gem install typhoeus
31+
# - cd doc/framework/ && HYDRA_MAX_CONCURRENCY=20 ruby .ci/dead-links.rb -p src/sdk/java/3/
3232

3333

3434
- stage: Tests

doc/3/controllers/collection/list/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Returns a `ConcurrentHashMap<String, Object>` containing the following propertie
2929
| Property | Type | Description |
3030
| ------------- | ------------------- | ------------------------------------------------------------------ |
3131
| `type` | <pre>String</pre> | Types of returned collections <br/>(`all`, `realtime` or `stored`) |
32-
| `collections` | <pre>ArrayList<Object></pre> | List of collections |
32+
| `collections` | `ArrayList<Object>` | List of collections |
3333
| `from` | <pre>Integer</pre> | Offset of the first result |
3434
| `size` | <pre>Integer</pre> | Maximum number of returned results |
3535

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
code: true
3+
type: page
4+
title: update
5+
description: Update the collection mapping
6+
---
7+
8+
# update
9+
10+
<SinceBadge version="Kuzzle 2.1.0" />
11+
12+
You can define the collection [dynamic mapping policy](/core/2/guides/essentials/database-mappings#dynamic-mapping-policy) by setting the `dynamic` field to the desired value.
13+
14+
You can define [collection additional metadata](/core/2/guides/essentials/database-mappings#collection-metadata) within the `_meta` root field.
15+
16+
<br/>
17+
18+
```java
19+
public CompletableFuture<Void> update(
20+
final String index,
21+
final String collection,
22+
final ConcurrentHashMap<String, Object> mapping)
23+
```
24+
25+
<br/>
26+
27+
| Arguments | Type | Description |
28+
| ------------ | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29+
| `index` | <pre>String</pre> | Index name |
30+
| `collection` | <pre>String</pre> | Collection name |
31+
| `mapping` | <pre>ConcurrentHashMap<String, Object></pre> | Describes the collection mapping |
32+
33+
### mapping
34+
35+
A `ConcurrentHashMap<String, Object>` representing the collection data mapping.
36+
37+
It must have a root field `properties` that contain the mapping definition:
38+
39+
```java
40+
{
41+
mappings={
42+
dynamic="[true|false|strict]",
43+
_meta={
44+
field="value"
45+
},
46+
properties={
47+
field1={ type='text' },
48+
field2={
49+
properties={
50+
nestedField={ type='keyword' }
51+
}
52+
}
53+
}
54+
}
55+
};
56+
```
57+
58+
More information about database mappings [here](/core/2/guides/essentials/database-mappings).
59+
60+
## Returns
61+
62+
Returns a `CompletableFuture<Void>`.
63+
64+
## Usage
65+
66+
<<< ./snippets/update.java
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ConcurrentHashMap<String, Object> mapping = new ConcurrentHashMap<>();
2+
ConcurrentHashMap<String, Object> properties = new ConcurrentHashMap<>();
3+
ConcurrentHashMap<String, Object> license = new ConcurrentHashMap<>();
4+
5+
license.put("type", "keyword");
6+
properties.put("license", license);
7+
mapping.put("properties", properties);
8+
9+
kuzzle
10+
.getCollectionController()
11+
.update("nyc-open-data", "yellow-taxi", mapping)
12+
.get();
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: collection#update
2+
description: Update the collection mapping
3+
hooks:
4+
before: curl -X POST kuzzle:7512/nyc-open-data/_create && curl -X PUT kuzzle:7512/nyc-open-data/yellow-taxi
5+
after:
6+
template: default
7+
expected: Success

doc/3/controllers/collection/validate-specifications/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ It contains the following properties:
4343
| Property | Type | Description |
4444
| ------------- | ---------------------------- | ---------------------------- |
4545
| `valid` | <pre>Boolean</pre> | Specifications validity |
46-
| `details` | <pre>ArrayList<String></pre> | Specifications errors |
46+
| `details` | `ArrayList<String>` | Specifications errors |
4747
| `description` | <pre>String</pre> | Global description of errors |
4848

4949
## Usage

doc/3/controllers/document/m-delete/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ throws NotConnectedException, InternalException
2626
| ------------------ | ------------------------------------------------------- | --------------------------------- |
2727
| `index` | <pre>String</pre> | Index name |
2828
| `collection` | <pre>String</pre> | Collection name |
29-
| `ids` | <pre>ArrayList<String></pre> | Document IDs |
29+
| `ids` | `ArrayList<String>` | Document IDs |
3030
---
3131

3232
## Return

doc/3/controllers/document/m-get/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ throws NotConnectedException, InternalException
2626
| ------------------ | ------------------------------------------------------- | --------------------------------- |
2727
| `index` | <pre>String</pre> | Index name |
2828
| `collection` | <pre>String</pre> | Collection name |
29-
| `ids` | <pre>ArrayList<String></pre> | Document IDs |
29+
| `ids` | `ArrayList<String>` | Document IDs |
3030
---
3131

3232
## Return

doc/3/controllers/document/update/snippets/update.test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ hooks:
88
curl -XPOST -d '{"name":"John"}' -H "Content-Type: application/json" kuzzle:7512/nyc-open-data/yellow-taxi/some-id/_create
99
after:
1010
template: print-result
11-
expected: ^{_source={name=Johny,\ _kuzzle_info={updatedAt=[0-9]+,\ updater=-1}},\ _id=some-id,\ _version=2}$
11+
expected: "_id=some-id, _version=2"

doc/3/controllers/index/m-delete/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CompletableFuture<ArrayList<String>> mDelete(final ArrayList<String> indexes)
1818

1919
| Argument | Type | Description |
2020
|-----------|-------------------|-----------------------|
21-
| `indexes` | <pre>ArrayList<String></pre> | List of indexes names |
21+
| `indexes` | `ArrayList<String>` | List of indexes names |
2222

2323
## Return
2424

0 commit comments

Comments
 (0)