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: src/api/IndexApi.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ export default class IndexApi {
45
45
46
46
/**
47
47
* Bulk table operations
48
-
* Sends multiple operatons like inserts, updates, replaces or deletes. For each operation it's object must have same format as in their dedicated method. The method expects a raw string as the batch in NDJSON. Each operation object needs to be serialized to JSON and separated by endline (\\n). An example of raw input: ``` {\"insert\": {\"table\": \"movies\", \"doc\": {\"plot\": \"A secret team goes to North Pole\", \"rating\": 9.5, \"language\": [2, 3], \"title\": \"This is an older movie\", \"lon\": 51.99, \"meta\": {\"keywords\":[\"travel\",\"ice\"],\"genre\":[\"adventure\"]}, \"year\": 1950, \"lat\": 60.4, \"advise\": \"PG-13\"}}} \\n {\"delete\": {\"table\": \"movies\",\"id\":700}} ``` Responds with an object telling whenever any errors occured and an array with status for each operation: ``` { 'items': [ { 'update':{'table':'products','_id':1,'result':'updated'}}, { 'update':{'table':'products','_id':2,'result':'updated'} } ], 'errors':false } ```
48
+
* Sends multiple operatons like inserts, updates, replaces or deletes. For each operation it's object must have same format as in their dedicated method. The method expects a raw string as the batch in NDJSON. Each operation object needs to be serialized to JSON and separated by endline (\\n). An example of raw input: ``` {\"insert\": {\"table\": \"movies\", \"doc\": {\"plot\": \"A secret team goes to North Pole\", \"rating\": 9.5, \"language\": [2, 3], \"title\": \"This is an older movie\", \"lon\": 51.99, \"meta\": {\"keywords\":[\"travel\",\"ice\"],\"genre\":[\"adventure\"]}, \"year\": 1950, \"lat\": 60.4, \"advise\": \"PG-13\"}}} \\n {\"delete\": {\"table\": \"movies\",\"id\":700}} ``` Responds with an object telling whenever any errors occured and an array with status for each operation: ``` { 'items': [ { 'update':{'table':'products','id':1,'result':'updated'}}, { 'update':{'table':'products','id':2,'result':'updated'} } ], 'errors':false } ```
49
49
* @param {String} body
50
50
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BulkResponse} and HTTP response
51
51
*/
@@ -78,7 +78,7 @@ export default class IndexApi {
78
78
79
79
/**
80
80
* Bulk table operations
81
-
* Sends multiple operatons like inserts, updates, replaces or deletes. For each operation it's object must have same format as in their dedicated method. The method expects a raw string as the batch in NDJSON. Each operation object needs to be serialized to JSON and separated by endline (\\n). An example of raw input: ``` {\"insert\": {\"table\": \"movies\", \"doc\": {\"plot\": \"A secret team goes to North Pole\", \"rating\": 9.5, \"language\": [2, 3], \"title\": \"This is an older movie\", \"lon\": 51.99, \"meta\": {\"keywords\":[\"travel\",\"ice\"],\"genre\":[\"adventure\"]}, \"year\": 1950, \"lat\": 60.4, \"advise\": \"PG-13\"}}} \\n {\"delete\": {\"table\": \"movies\",\"id\":700}} ``` Responds with an object telling whenever any errors occured and an array with status for each operation: ``` { 'items': [ { 'update':{'table':'products','_id':1,'result':'updated'}}, { 'update':{'table':'products','_id':2,'result':'updated'} } ], 'errors':false } ```
81
+
* Sends multiple operatons like inserts, updates, replaces or deletes. For each operation it's object must have same format as in their dedicated method. The method expects a raw string as the batch in NDJSON. Each operation object needs to be serialized to JSON and separated by endline (\\n). An example of raw input: ``` {\"insert\": {\"table\": \"movies\", \"doc\": {\"plot\": \"A secret team goes to North Pole\", \"rating\": 9.5, \"language\": [2, 3], \"title\": \"This is an older movie\", \"lon\": 51.99, \"meta\": {\"keywords\":[\"travel\",\"ice\"],\"genre\":[\"adventure\"]}, \"year\": 1950, \"lat\": 60.4, \"advise\": \"PG-13\"}}} \\n {\"delete\": {\"table\": \"movies\",\"id\":700}} ``` Responds with an object telling whenever any errors occured and an array with status for each operation: ``` { 'items': [ { 'update':{'table':'products','id':1,'result':'updated'}}, { 'update':{'table':'products','id':2,'result':'updated'} } ], 'errors':false } ```
82
82
* @param {String} body
83
83
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BulkResponse}
84
84
*/
@@ -139,7 +139,7 @@ export default class IndexApi {
139
139
140
140
/**
141
141
* Create a new document in a table
142
-
* Insert a document. Expects an object like: ``` { 'table':'movies', 'id':701, 'doc': { 'title':'This is an old movie', 'plot':'A secret team goes to North Pole', 'year':1950, 'rating':9.5, 'lat':60.4, 'lon':51.99, 'advise':'PG-13', 'meta':'{\"keywords\":{\"travel\",\"ice\"},\"genre\":{\"adventure\"}}', 'language':[2,3] }} ``` The document id can also be missing, in which case an autogenerated one will be used: ``` { 'table':'movies', 'doc': { 'title':'This is a new movie', 'plot':'A secret team goes to North Pole', 'year':2020, 'rating':9.5, 'lat':60.4, 'lon':51.99, 'advise':'PG-13', 'meta':'{\"keywords\":{\"travel\",\"ice\"},\"genre\":{\"adventure\"}}', 'language':[2,3] }} ``` It responds with an object in format: ``` {'table':'products','_id':701,'created':true,'result':'created','status':201} ```
142
+
* Insert a document. Expects an object like: ``` { 'table':'movies', 'id':701, 'doc': { 'title':'This is an old movie', 'plot':'A secret team goes to North Pole', 'year':1950, 'rating':9.5, 'lat':60.4, 'lon':51.99, 'advise':'PG-13', 'meta':'{\"keywords\":{\"travel\",\"ice\"},\"genre\":{\"adventure\"}}', 'language':[2,3] }} ``` The document id can also be missing, in which case an autogenerated one will be used: ``` { 'table':'movies', 'doc': { 'title':'This is a new movie', 'plot':'A secret team goes to North Pole', 'year':2020, 'rating':9.5, 'lat':60.4, 'lon':51.99, 'advise':'PG-13', 'meta':'{\"keywords\":{\"travel\",\"ice\"},\"genre\":{\"adventure\"}}', 'language':[2,3] }} ``` It responds with an object in format: ``` {'table':'products','id':701,'created':true,'result':'created','status':201} ```
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SuccessResponse} and HTTP response
145
145
*/
@@ -172,7 +172,7 @@ export default class IndexApi {
172
172
173
173
/**
174
174
* Create a new document in a table
175
-
* Insert a document. Expects an object like: ``` { 'table':'movies', 'id':701, 'doc': { 'title':'This is an old movie', 'plot':'A secret team goes to North Pole', 'year':1950, 'rating':9.5, 'lat':60.4, 'lon':51.99, 'advise':'PG-13', 'meta':'{\"keywords\":{\"travel\",\"ice\"},\"genre\":{\"adventure\"}}', 'language':[2,3] }} ``` The document id can also be missing, in which case an autogenerated one will be used: ``` { 'table':'movies', 'doc': { 'title':'This is a new movie', 'plot':'A secret team goes to North Pole', 'year':2020, 'rating':9.5, 'lat':60.4, 'lon':51.99, 'advise':'PG-13', 'meta':'{\"keywords\":{\"travel\",\"ice\"},\"genre\":{\"adventure\"}}', 'language':[2,3] }} ``` It responds with an object in format: ``` {'table':'products','_id':701,'created':true,'result':'created','status':201} ```
175
+
* Insert a document. Expects an object like: ``` { 'table':'movies', 'id':701, 'doc': { 'title':'This is an old movie', 'plot':'A secret team goes to North Pole', 'year':1950, 'rating':9.5, 'lat':60.4, 'lon':51.99, 'advise':'PG-13', 'meta':'{\"keywords\":{\"travel\",\"ice\"},\"genre\":{\"adventure\"}}', 'language':[2,3] }} ``` The document id can also be missing, in which case an autogenerated one will be used: ``` { 'table':'movies', 'doc': { 'title':'This is a new movie', 'plot':'A secret team goes to North Pole', 'year':2020, 'rating':9.5, 'lat':60.4, 'lon':51.99, 'advise':'PG-13', 'meta':'{\"keywords\":{\"travel\",\"ice\"},\"genre\":{\"adventure\"}}', 'language':[2,3] }} ``` It responds with an object in format: ``` {'table':'products','id':701,'created':true,'result':'created','status':201} ```
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SuccessResponse}
178
178
*/
@@ -247,7 +247,7 @@ export default class IndexApi {
247
247
248
248
/**
249
249
* Replace new document in a table
250
-
* Replace an existing document. Input has same format as `insert` operation. Responds with an object in format: ``` {'table':'products','_id':1,'created':false,'result':'updated','status':200} ```
250
+
* Replace an existing document. Input has same format as `insert` operation. Responds with an object in format: ``` {'table':'products','id':1,'created':false,'result':'updated','status':200} ```
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SuccessResponse} and HTTP response
253
253
*/
@@ -280,7 +280,7 @@ export default class IndexApi {
280
280
281
281
/**
282
282
* Replace new document in a table
283
-
* Replace an existing document. Input has same format as `insert` operation. Responds with an object in format: ``` {'table':'products','_id':1,'created':false,'result':'updated','status':200} ```
283
+
* Replace an existing document. Input has same format as `insert` operation. Responds with an object in format: ``` {'table':'products','id':1,'created':false,'result':'updated','status':200} ```
0 commit comments