Skip to content

Commit 00074d6

Browse files
Rename Field to Column, Index to Insert and Project to Database
1 parent 299de41 commit 00074d6

File tree

12 files changed

+30108
-30120
lines changed

12 files changed

+30108
-30120
lines changed

README.md

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Official JavaScript client for [SlicingDice](http://www.slicingdice.com/), Data
99

1010
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.
1111

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

1414
## Tests and Examples
1515

@@ -42,14 +42,14 @@ const client = new SlicingDice({
4242
readKey: 'READ_API_KEY'
4343
}, usesTestEndpoint = true);
4444

45-
// Indexing data
46-
const indexData = {
45+
// Inserting data
46+
const insertData = {
4747
"user1@slicingdice.com": {
4848
"age": 22
4949
},
50-
"auto-create-fields": true
50+
"auto-create-columns": true
5151
};
52-
client.index(indexData);
52+
client.insert(insertData);
5353

5454
// Querying data
5555
const queryData = {
@@ -86,8 +86,8 @@ client.countEntity(queryData).then((resp) => {
8686
* `apiKeys (Object)` - [API key](http://panel.slicingdice.com/docs/#api-details-api-connection-api-keys) to authenticate requests with the SlicingDice API.
8787
* `usesTestEndpoint (boolean)` - If false the client will send requests to production end-point, otherwise to tests end-point.
8888

89-
### `getProjects()`
90-
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).
9191

9292
#### Request example
9393

@@ -98,7 +98,7 @@ const client = new SlicingDice({
9898
masterKey: 'MASTER_API_KEY'
9999
}, usesTestEndpoint = false);
100100

101-
client.getProjects().then((resp) => {
101+
client.getDatabase().then((resp) => {
102102
console.log(resp);
103103
}, (err) => {
104104
console.error(err);
@@ -109,27 +109,15 @@ client.getProjects().then((resp) => {
109109

110110
```json
111111
{
112-
"active": [
113-
{
114-
"name": "Project 1",
115-
"description": "My first project",
116-
"data-expiration": 30,
117-
"created-at": "2016-04-05T10:20:30Z"
118-
}
119-
],
120-
"inactive": [
121-
{
122-
"name": "Project 2",
123-
"description": "My second project",
124-
"data-expiration": 90,
125-
"created-at": "2016-04-05T10:20:30Z"
126-
}
127-
]
112+
"name": "Database 1",
113+
"description": "My first database",
114+
"data-expiration": 30,
115+
"created-at": "2016-04-05T10:20:30Z"
128116
}
129117
```
130118

131-
### `getFields()`
132-
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).
133121

134122
#### Request example
135123

@@ -140,7 +128,7 @@ const client = new SlicingDice({
140128
masterKey: 'MASTER_API_KEY'
141129
}, usesTestEndpoint = true);
142130

143-
client.getFields().then((resp) => {
131+
client.getColumns().then((resp) => {
144132
console.log(resp);
145133
}, (err) => {
146134
console.error(err);
@@ -175,8 +163,8 @@ client.getFields().then((resp) => {
175163
}
176164
```
177165

178-
### `createField(jsonData)`
179-
Create a new field. This method corresponds to a [POST request at /field](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-field).
166+
### `createColumn(jsonData)`
167+
Create a new column. This method corresponds to a [POST request at /column](http://panel.slicingdice.com/docs/#api-details-api-endpoints-post-column).
180168

181169
#### Request example
182170

@@ -187,15 +175,15 @@ const client = new SlicingDice({
187175
masterKey: 'MASTER_API_KEY'
188176
}, usesTestEndpoint = true);
189177

190-
field = {
178+
column = {
191179
"name": "Year",
192180
"api-name": "year",
193181
"type": "integer",
194182
"description": "Year of manufacturing",
195183
"storage": "latest-value"
196184
};
197185

198-
client.createField(field).then((resp) => {
186+
client.createColumn(column).then((resp) => {
199187
console.log(resp);
200188
}, (err) => {
201189
console.error(err);
@@ -211,8 +199,8 @@ client.createField(field).then((resp) => {
211199
}
212200
```
213201

214-
### `index(jsonData)`
215-
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).
216204

217205
#### Request example
218206

@@ -224,7 +212,7 @@ const client = new SlicingDice({
224212
writeKey: 'WRITE_API_KEY'
225213
}, usesTestEndpoint = true);
226214

227-
const indexData = {
215+
const insertData = {
228216
"user1@slicingdice.com": {
229217
"car-model": "Ford Ka",
230218
"year": 2016
@@ -259,7 +247,7 @@ const indexData = {
259247
}
260248
};
261249

262-
client.index(indexData, autoCreateFields = true).then((resp) => {
250+
client.insert(insertData, autoCreateColumns = true).then((resp) => {
263251
console.log(resp);
264252
}, (err) => {
265253
console.error(err);
@@ -271,14 +259,14 @@ client.index(indexData, autoCreateFields = true).then((resp) => {
271259
```json
272260
{
273261
"status": "success",
274-
"indexed-entities": 4,
275-
"indexed-fields": 10,
262+
"inserted-entities": 4,
263+
"inserted-columns": 10,
276264
"took": 0.023
277265
}
278266
```
279267

280268
### `existsEntity(ids)`
281-
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).
282270

283271
#### Request example
284272

@@ -320,7 +308,7 @@ client.existsEntity(ids).then((resp) => {
320308
```
321309

322310
### `countEntityTotal()`
323-
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).
324312

325313
#### Request example
326314

@@ -550,7 +538,7 @@ client.topValues(query).then((resp) => {
550538
```
551539

552540
### `aggregation(jsonData)`
553-
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).
554542

555543
#### Request example
556544

@@ -885,7 +873,7 @@ client.deleteSavedQuery("my-saved-query").then((resp) => {
885873
```
886874

887875
### `result(jsonData)`
888-
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).
889877

890878
#### Request example
891879

@@ -911,7 +899,7 @@ query = {
911899
}
912900
}
913901
],
914-
"fields": ["car-model", "year"],
902+
"columns": ["car-model", "year"],
915903
"limit": 2
916904
};
917905

@@ -944,7 +932,7 @@ client.result(query).then((resp) => {
944932
```
945933

946934
### `score(jsonData)`
947-
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).
948936

949937
#### Request example
950938

@@ -970,7 +958,7 @@ query = {
970958
}
971959
}
972960
],
973-
"fields": ["car-model", "year"],
961+
"columns": ["car-model", "year"],
974962
"limit": 2
975963
};
976964

0 commit comments

Comments
 (0)