cxUserspace

cxUserspace

Create, Read, Update & Delete from the Userspace Database

Example

const cxUserspace = require('cxUserspace');
async function main(data) {
  var result = await cxUserspace.read(data.routing.dest_number);
  // Do something with result
  return data
}

Methods

(static) create(area, key, data) → {Promise}

Source:

Create Record

Example
await cxUserspace.create('myDatabase', 1, {value: 'Hello World!'})
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}

Source:

Delete Record

Example
await cxUserspace.delete('myDatabase', 1)
Parameters:
Name Type Description
area string

Datastore Name

key string | number

Row Id

Returns:
Type
Promise

(static) read(read, key) → {Promise.<object>}

Source:

Create Record

Example
var data = await cxUserspace.read('myDatabase', 1)
Parameters:
Name Type Description
read string

Datastore Name

key string | number

Row Id

Returns:
Type
Promise.<object>

(static) update(area, key, data) → {Promise}

Source:

Update Record

Example
await cxUserspace.update('myDatabase', 1, {value: 'Hello World!'})
Parameters:
Name Type Description
area string

Datastore Name

key string | number

Row Id

data object

Data Object / Row

Returns:
Type
Promise