Methods
(static) create(area, key, data) → {Promise}
Create Record
Example
await rest.create('customer', {name: 'Joe Blogs'}})
Parameters:
Name | Type | Description |
---|---|---|
area |
string | Datastore Name |
key |
string | number | Row Id |
data |
object | Data Object / Row |
Returns:
- Type
- Promise
(static) delete(area, key) → {Promise}
Delete Record
Example
await rest.delete('customer/1234')
Parameters:
Name | Type | Description |
---|---|---|
area |
string | Datastore Name |
key |
string | number | Row Id |
Returns:
- Type
- Promise
(static) read(read, key) → {Promise.<object>}
Create Record
Example
var data = await rest.read('customer/1234')
Parameters:
Name | Type | Description |
---|---|---|
read |
string | Datastore Name |
key |
string | number | Row Id |
Returns:
- Type
- Promise.<object>
(static) update(area, key, data) → {Promise}
Update Record
Example
await rest.update('customer/1234', {name: 'Alice'})
Parameters:
Name | Type | Description |
---|---|---|
area |
string | Datastore Name |
key |
string | number | Row Id |
data |
object | Data Object / Row |
Returns:
- Type
- Promise