-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Attila Laszlo
committed
Feb 1, 2017
1 parent
e7ff78c
commit e009fde
Showing
63 changed files
with
1,438 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../documents/API/v1.5.0-sprint/swagger.json → ...wwwroot/documents/API/v1.5.0/swagger.json
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/DevelopersSite/wwwroot/documents/SDK.NET/v1.5.0/dataset.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<h2 id="dataset">Dataset</h2> | ||
<p>Slamby provides <strong>Dataset</strong> as a data storage. A dataset is a JSON document storage that allows to store schema free JSON objects, indexes and additional parameters. Inside your server you can create and manage multiple datasets.</p> | ||
<p>You can find more details about the Datasets <a href="/docs/api/{{docversion}}/dataset">here.</a></p> | ||
<h3 id="create-new-dataset">Create new Dataset</h3> | ||
<p>Create a new dataset by providing a sample JSON document and additional parameters.</p> | ||
<p><em>Example:</em></p> | ||
<pre><code class="lang-cs"><span class="hljs-keyword">var</span> manager = <span class="hljs-keyword">new</span> DataSetManager(configuration);<br><span class="hljs-keyword">var</span> dataset = <span class="hljs-keyword">new</span> Models.DataSet()<br> {<br> IdField = <span class="hljs-string">"id"</span>,<br> Name = <span class="hljs-string">"name"</span>,<br> NGramCount = <span class="hljs-number">2</span>,<br> InterpretedFields = <span class="hljs-keyword">new</span> List<<span class="hljs-keyword">string</span>> { <span class="hljs-string">"title"</span>, <span class="hljs-string">"desc"</span> },<br> TagField = <span class="hljs-string">"tag"</span>,<br> SampleDocument = <span class="hljs-keyword">new</span><br> {<br> id = <span class="hljs-number">10</span>,<br> title = <span class="hljs-string">"Example Product Title"</span>,<br> desc = <span class="hljs-string">"Example Product Description"</span>,<br> tag = [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>]<br> }<br> }<br><span class="hljs-keyword">var</span> response = <span class="hljs-keyword">await</span> manager.CreateDataSetAsync(dataset);<br><span class="hljs-keyword">if</span> (!response.IsSuccessful)<br>{<br> <span class="hljs-comment">// handle error with the help of the Errors property in the response</span><br>} | ||
</code></pre> | ||
<p>Create a new dataset by providing a JSON schema and additional parameters.</p> | ||
<p><em>Example:</em></p> | ||
<pre><code class="lang-cs"><span class="hljs-keyword">var</span> manager = <span class="hljs-keyword">new</span> DataSetManager(configuration);<br><span class="hljs-keyword">var</span> dataset = <span class="hljs-keyword">new</span> Models.DataSet<br> {<br> IdField = <span class="hljs-string">"id"</span>,<br> Name = <span class="hljs-string">"name"</span>,<br> NGramCount = <span class="hljs-number">2</span>,<br> InterpretedFields = <span class="hljs-keyword">new</span> List<<span class="hljs-keyword">string</span>> { <span class="hljs-string">"title"</span>, <span class="hljs-string">"desc"</span> },<br> TagField = <span class="hljs-string">"tag"</span>,<br> Schema = <span class="hljs-keyword">new</span><br> {<br> id = <span class="hljs-keyword">new</span> <br> {<br> type = <span class="hljs-string">"integer"</span><br> },<br> title = <span class="hljs-keyword">new</span> <br> {<br> type = <span class="hljs-string">"string"</span><br> },<br> desc = <span class="hljs-keyword">new</span> <br> {<br> type = <span class="hljs-string">"string"</span><br> },<br> tag = <span class="hljs-keyword">new</span> <br> {<br> type = <span class="hljs-string">"array"</span>,<br> items = <span class="hljs-keyword">new</span><br> {<br> type = <span class="hljs-string">"byte"</span><br> }<br> }<br> }<br> }<br><span class="hljs-keyword">var</span> response = <span class="hljs-keyword">await</span> manager.CreateDataSchemaSetAsync(dataset);<br><span class="hljs-keyword">if</span> (!response.IsSuccessful)<br>{<br> <span class="hljs-comment">// handle error with the help of the Errors property in the response</span><br>} | ||
</code></pre> | ||
<h3 id="get-dataset">Get Dataset</h3> | ||
<p>Get information about a given dataset. A dataset can be accessed by its name.</p> | ||
<p><em>Example:</em></p> | ||
<pre><code class="lang-cs"><span class="hljs-keyword">var</span> manager = <span class="hljs-keyword">new</span> DataSetManager(configuration);<br><span class="hljs-keyword">var</span> dataset = <span class="hljs-keyword">await</span> manager.GetDataSetAsync(); | ||
</code></pre> | ||
<h3 id="get-dataset-list">Get Dataset List</h3> | ||
<p>Get a list of the available datasets.</p> | ||
<p><em>Example:</em></p> | ||
<pre><code class="lang-cs"><span class="hljs-keyword">var</span> manager = <span class="hljs-keyword">new</span> DataSetManager(configuration);<br><span class="hljs-keyword">var</span> datasets = <span class="hljs-keyword">await</span> manager.GetDataSetsAsync(); | ||
</code></pre> | ||
<h3 id="update-dataset">Update Dataset</h3> | ||
<p>Updates a dataset. Currently only updating Dataset name is possible. As Dataset names are unique it will return with an error if the name is taken by another Dataset.</p> | ||
<p><em>Example:</em></p> | ||
<pre><code class="lang-cs"><span class="hljs-keyword">var</span> manager = <span class="hljs-keyword">new</span> DataSetManager(configuration);<br><span class="hljs-keyword">var</span> model = <span class="hljs-keyword">new</span> DataSetUpdate()<br>{<br> Name = <span class="hljs-string">"NEW_DATASET_NAME"</span><br>};<br><span class="hljs-keyword">var</span> datasets = <span class="hljs-keyword">await</span> manager.UpdateDataSetAsync(model); | ||
</code></pre> | ||
<h3 id="remove-dataset">Remove Dataset</h3> | ||
<p>Removes a given dataset. All the stored data will be removed.</p> | ||
<p><em>Example:</em></p> | ||
<pre><code class="lang-cs"><span class="hljs-keyword">var</span> manager = <span class="hljs-keyword">new</span> DataSetManager(configuration);<br><span class="hljs-keyword">var</span> result = <span class="hljs-keyword">await</span> manager.DeleteDataSetAsync(<span class="hljs-string">"DATASET_NAME"</span>); | ||
</code></pre> |
128 changes: 128 additions & 0 deletions
128
src/DevelopersSite/wwwroot/documents/SDK.NET/v1.5.0/dataset.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
## Dataset | ||
|
||
Slamby provides **Dataset** as a data storage. A dataset is a JSON document storage that allows to store schema free JSON objects, indexes and additional parameters. Inside your server you can create and manage multiple datasets. | ||
|
||
You can find more details about the Datasets [here.](/docs/api/{{docversion}}/dataset) | ||
|
||
### Create new Dataset | ||
|
||
Create a new dataset by providing a sample JSON document and additional parameters. | ||
|
||
_Example:_ | ||
|
||
```cs | ||
var manager = new DataSetManager(configuration); | ||
var dataset = new Models.DataSet() | ||
{ | ||
IdField = "id", | ||
Name = "name", | ||
NGramCount = 2, | ||
InterpretedFields = new List<string> { "title", "desc" }, | ||
TagField = "tag", | ||
SampleDocument = new | ||
{ | ||
id = 10, | ||
title = "Example Product Title", | ||
desc = "Example Product Description", | ||
tag = [1,2,3] | ||
} | ||
} | ||
var response = await manager.CreateDataSetAsync(dataset); | ||
if (!response.IsSuccessful) | ||
{ | ||
// handle error with the help of the Errors property in the response | ||
} | ||
``` | ||
|
||
Create a new dataset by providing a JSON schema and additional parameters. | ||
|
||
_Example:_ | ||
|
||
```cs | ||
var manager = new DataSetManager(configuration); | ||
var dataset = new Models.DataSet | ||
{ | ||
IdField = "id", | ||
Name = "name", | ||
NGramCount = 2, | ||
InterpretedFields = new List<string> { "title", "desc" }, | ||
TagField = "tag", | ||
Schema = new | ||
{ | ||
id = new | ||
{ | ||
type = "integer" | ||
}, | ||
title = new | ||
{ | ||
type = "string" | ||
}, | ||
desc = new | ||
{ | ||
type = "string" | ||
}, | ||
tag = new | ||
{ | ||
type = "array", | ||
items = new | ||
{ | ||
type = "byte" | ||
} | ||
} | ||
} | ||
} | ||
var response = await manager.CreateDataSchemaSetAsync(dataset); | ||
if (!response.IsSuccessful) | ||
{ | ||
// handle error with the help of the Errors property in the response | ||
} | ||
``` | ||
|
||
### Get Dataset | ||
|
||
Get information about a given dataset. A dataset can be accessed by its name. | ||
|
||
_Example:_ | ||
|
||
```cs | ||
var manager = new DataSetManager(configuration); | ||
var dataset = await manager.GetDataSetAsync(); | ||
``` | ||
|
||
### Get Dataset List | ||
|
||
Get a list of the available datasets. | ||
|
||
_Example:_ | ||
|
||
```cs | ||
var manager = new DataSetManager(configuration); | ||
var datasets = await manager.GetDataSetsAsync(); | ||
``` | ||
|
||
### Update Dataset | ||
|
||
Updates a dataset. Currently only updating Dataset name is possible. As Dataset names are unique it will return with an error if the name is taken by another Dataset. | ||
|
||
_Example:_ | ||
|
||
```cs | ||
var manager = new DataSetManager(configuration); | ||
var model = new DataSetUpdate() | ||
{ | ||
Name = "NEW_DATASET_NAME" | ||
}; | ||
var datasets = await manager.UpdateDataSetAsync(model); | ||
``` | ||
|
||
|
||
### Remove Dataset | ||
|
||
Removes a given dataset. All the stored data will be removed. | ||
|
||
_Example:_ | ||
|
||
```cs | ||
var manager = new DataSetManager(configuration); | ||
var result = await manager.DeleteDataSetAsync("DATASET_NAME"); | ||
``` |
Oops, something went wrong.