You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+91-88Lines changed: 91 additions & 88 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Official JavaScript client for [SlicingDice](http://www.slicingdice.com/), Data
9
9
10
10
If you are new to SlicingDice, check our [quickstart guide](http://panel.slicingdice.com/docs/#quickstart-guide) and learn to use it in 15 minutes.
11
11
12
-
Please refer to the [SlicingDice official documentation](http://panel.slicingdice.com/docs/) for more information on [analytics databases](http://panel.slicingdice.com/docs/#analytics-concepts), [data modeling](http://panel.slicingdice.com/docs/#data-modeling), [indexing](http://panel.slicingdice.com/docs/#data-indexing), [querying](http://panel.slicingdice.com/docs/#data-querying), [limitations](http://panel.slicingdice.com/docs/#current-slicingdice-limitations) and [API details](http://panel.slicingdice.com/docs/#api-details).
12
+
Please refer to the [SlicingDice official documentation](http://panel.slicingdice.com/docs/) for more information on [analytics databases](http://panel.slicingdice.com/docs/#analytics-concepts), [data modeling](http://panel.slicingdice.com/docs/#data-modeling), [data insertion](http://panel.slicingdice.com/docs/#data-insertion), [querying](http://panel.slicingdice.com/docs/#data-querying), [limitations](http://panel.slicingdice.com/docs/#current-slicingdice-limitations) and [API details](http://panel.slicingdice.com/docs/#api-details).
13
13
14
14
## Tests and Examples
15
15
@@ -42,18 +42,19 @@ const client = new SlicingDice({
*`apiKeys (Object)` - [API key](http://panel.slicingdice.com/docs/#api-details-api-connection-api-keys) to authenticate requests with the SlicingDice API.
86
87
*`usesTestEndpoint (boolean)` - If false the client will send requests to production end-point, otherwise to tests end-point.
87
88
88
-
### `getProjects()`
89
-
Get all created projects, both active and inactive ones. This method corresponds to a [GET request at /project](http://panel.slicingdice.com/docs/#api-details-api-endpoints-get-project).
89
+
### `getDatabase()`
90
+
Get information about current database. This method corresponds to a [GET request at /database](http://panel.slicingdice.com/docs/#api-details-api-endpoints-get-database).
90
91
91
92
#### Request example
92
93
@@ -97,7 +98,7 @@ const client = new SlicingDice({
Get all created fields, both active and inactive ones. This method corresponds to a [GET request at /field](http://panel.slicingdice.com/docs/#api-details-api-endpoints-get-field).
119
+
### `getColumns()`
120
+
Get all created columns, both active and inactive ones. This method corresponds to a [GET request at /column](http://panel.slicingdice.com/docs/#api-details-api-endpoints-get-column).
132
121
133
122
#### Request example
134
123
@@ -139,7 +128,7 @@ const client = new SlicingDice({
Index data to existing entities or create new entities, if necessary. This method corresponds to a [POST request at /index](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-index).
202
+
### `insert(jsonData)`
203
+
Insert data to existing entities or create new entities, if necessary. This method corresponds to a [POST request at /insert](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-insert).
215
204
216
205
#### Request example
217
206
@@ -223,7 +212,7 @@ const client = new SlicingDice({
Verify which entities exist in a project given a list of entity IDs. This method corresponds to a [POST request at /query/exists/entity](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-query-exists-entity).
269
+
Verify which entities exist in a database given a list of entity IDs. This method corresponds to a [POST request at /query/exists/entity](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-query-exists-entity).
Count the number of indexed entities. This method corresponds to a [GET request at /query/count/entity/total](http://panel.slicingdice.com/docs/#api-details-api-endpoints-get-query-count-entity-total).
311
+
Count the number of inserted entities. This method corresponds to a [GET request at /query/count/entity/total](http://panel.slicingdice.com/docs/#api-details-api-endpoints-get-query-count-entity-total).
323
312
324
313
#### Request example
325
314
@@ -363,29 +352,36 @@ const client = new SlicingDice({
363
352
readKey:'READ_KEY'
364
353
}, usesTestEndpoint =true);
365
354
366
-
query = {
367
-
"corolla-or-fit": [
368
-
{
369
-
"car-model": {
370
-
"equals":"toyota corolla"
371
-
}
372
-
},
373
-
"or",
374
-
{
375
-
"car-model": {
376
-
"equals":"honda fit"
355
+
constquery= [
356
+
{
357
+
"query-name":"corolla-or-fit",
358
+
"query": [
359
+
{
360
+
"car-model": {
361
+
"equals":"toyota corolla"
362
+
}
363
+
},
364
+
"or",
365
+
{
366
+
"car-model": {
367
+
"equals":"honda fit"
368
+
}
377
369
}
378
-
},
379
-
],
380
-
"ford-ka": [
381
-
{
382
-
"car-model": {
383
-
"equals":"ford ka"
370
+
],
371
+
"bypass-cache":false
372
+
},
373
+
{
374
+
"query-name":"ford-ka",
375
+
"query": [
376
+
{
377
+
"car-model": {
378
+
"equals":"ford ka"
379
+
}
384
380
}
385
-
}
386
-
],
387
-
"bypass-cache":false
388
-
};
381
+
],
382
+
"bypass-cache":false
383
+
}
384
+
];
389
385
390
386
client.countEntity(query).then((resp) => {
391
387
console.log(resp);
@@ -420,31 +416,38 @@ const client = new SlicingDice({
Return the aggregation of all fields in the given query. This method corresponds to a [POST request at /query/aggregation](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-query-aggregation).
541
+
Return the aggregation of all columns in the given query. This method corresponds to a [POST request at /query/aggregation](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-query-aggregation).
Retrieve indexed values for entities matching the given query. This method corresponds to a [POST request at /data_extraction/result](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-data-extraction-result).
876
+
Retrieve inserted values for entities matching the given query. This method corresponds to a [POST request at /data_extraction/result](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-data-extraction-result).
Retrieve indexed values as well as their relevance for entities matching the given query. This method corresponds to a [POST request at /data_extraction/score](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-data-extraction-score).
935
+
Retrieve inserted values as well as their relevance for entities matching the given query. This method corresponds to a [POST request at /data_extraction/score](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-data-extraction-score).
0 commit comments