Skip to content

Commit

Permalink
Port #271 on 3-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Aschen committed May 29, 2019
1 parent afe3fa8 commit b808602
Show file tree
Hide file tree
Showing 126 changed files with 482 additions and 311 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Each right is an object with the following properties:

- `controller`: API controller
- `action`: controller's action
- `index`: authorized or denied data index
- `collection`: authorized or denied data collection
- `index`: authorized or denied index
- `collection`: authorized or denied collection
- `value`: one of the following value: `denied`, `allowed`, or `conditional`

```javascript
Expand Down
4 changes: 2 additions & 2 deletions src/core/1/api/api-reference/controller-bulk/import/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ Body:

## Arguments

- `collection`: data collection
- `index`: data index
- `collection`: collection name
- `index`: index name

---

Expand Down
36 changes: 25 additions & 11 deletions src/core/1/api/api-reference/controller-collection/create/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ title: create

# create

Creates a new [collection](/core/1/guide/guides/essentials/persisted), in the provided `index`.

<SinceBadge version="1.3.0" />

Creates a new [collection](/core/1/guide/guides/essentials/persisted/), in the provided `index`.
You can also provide an optional body with a [collection mapping](/core/1/guide/guides/essentials/database-mappings) allowing you to exploit the full capabilities of our persistent data storage layer.

<SinceBadge version="1.3.0" />
This method will only update the mapping when the collection already exists.

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.
<SinceBadge version="1.7.1" />

This method will only update the mapping if the collection already exists.
You can define the collection [dynamic mapping policy](/core/1/guide/guides/essentials/database-mappings/#dynamic-mapping-policy) by setting the `dynamic` field to the desired value.

You can define [collection additional metadata](/core/1/guide/guides/essentials/database-mappings/#collection-metadata) within the `_meta` root field.

---

Expand All @@ -30,6 +34,10 @@ Body:

```js
{
"dynamic": "[false|true|strict]",
"_meta": {
"field": "value"
},
"properties": {
"field1": {
"type": "integer"
Expand All @@ -38,8 +46,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"
}
}
}
Expand All @@ -54,6 +62,10 @@ Body:
"controller": "collection",
"action": "create",
"body": {
"dynamic": "[false|true|strict]",
"_meta": {
"field": "value"
},
"properties": {
"field1": {
"type": "integer"
Expand All @@ -62,8 +74,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"
}
}
}
Expand All @@ -74,16 +86,18 @@ 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 name that will host the new collection

---

## Body properties

### 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. 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)

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ title: deleteSpecifications



Deletes validation specifications for a data collection.
Deletes validation specifications for a collection.

The request succeeds even if no specification exist for that data collection.
The request succeeds even if no specification exist for that collection.

**_Note:_** an empty specification is implicitly applied to all collections. In a way, "no specification set" means "all documents are valid".

Expand Down Expand Up @@ -40,8 +40,8 @@ Method: DELETE

## Arguments

- `collection`: data collection
- `index`: data index
- `collection`: collection name
- `index`: index name

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ Method: GET

## Arguments

- `collection`: data collection
- `index`: data index
- `collection`: collection name
- `index`: index name

---

## Response

Returns a boolean telling whether the provided data collection exists:
Returns a boolean telling whether the provided collection exists:

```js
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ title: getMapping

# getMapping

Returns a collection mapping.

{{{since "1.7.1"}}}

Returns a data collection mapping.
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).

---

Expand Down Expand Up @@ -36,8 +38,8 @@ Method: GET

## Arguments

- `collection`: data collection
- `index`: data index
- `collection`: collection name
- `index`: index name

---

Expand All @@ -47,13 +49,17 @@ Returns a mapping object with the following structure:

```
<index>
|- mappings
|- <collection>
|- properties
|- mapping for field 1
|- mapping for field 2
|- ...
|- mapping for field n
|- mappings
|- <collection>
|- dynamic
|- _meta
|- metadata 1
|- metadata 1
|- properties
|- mapping for field 1
|- mapping for field 2
|- ...
|- mapping for field n
```

### Example:
Expand All @@ -71,23 +77,24 @@ Returns a mapping object with the following structure:
"<index>": {
"mappings": {
"<collection>": {
"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"
}
}
}
}
}
}
}

```

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ Method: GET

## Arguments

- `collection`: data collection
- `index`: data index
- `collection`: collection name
- `index`: index name

---

## Response

Returns a specifications object with the following properties:

- `collection`: specified data collection
- `index`: specified data index
- `collection`: specified collection
- `index`: specified index
- `validation`: specifications description

```js
Expand Down
10 changes: 5 additions & 5 deletions src/core/1/api/api-reference/controller-collection/list/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: list



Returns the list of data collections associated to a provided data index.
Returns the list of collections associated to a provided index.

The returned list is sorted in alphanumerical order.

Expand Down Expand Up @@ -40,8 +40,8 @@ Method: GET

## Arguments

- `collection`: data collection
- `index`: data index
- `collection`: collection name
- `index`: index name

### Optional:

Expand All @@ -54,8 +54,8 @@ Method: GET

Returns an array of objects, each one of those describing a collection, using the following properties:

- `name`: data collection name
- `type`: data collection type (either `stored` or `realtime`)
- `name`: collection name
- `type`: collection type (either `stored` or `realtime`)

Example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Method: GET

## Arguments

- `collection`: data collection
- `index`: data index
- `collection`: collection name
- `index`: index name
- `scrollId`: cursor identifier, obtained with (/core/1/api/api-reference/controller-collection/search-specifications/)

### Optional:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ Body:

## Arguments

- `collection`: data collection
- `index`: data index
- `collection`: collection name
- `index`: index name

### Optional:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ Method: DELETE

## Arguments

- `collection`: data collection
- `index`: data index
- `collection`: collection name
- `index`: index name

---

Expand Down
Loading

0 comments on commit b808602

Please sign in to comment.