storage

DB

Simple database service

Create Free

POSThttps://api.m3o.com/v1/db/Create

Create a record in the database. Optionally include an "id" field otherwise it's set automatically.

Request payload

record object

JSON encoded record or records (can be array or object)

table string

Optional table name. Defaults to 'default'

Response

id string

The id of the record (either specified or automatically created)

Delete Free

POSThttps://api.m3o.com/v1/db/Delete

Delete a record in the database by id.

Request payload

id string

id of the record

table string

Optional table name. Defaults to 'default'

Read Free

POSThttps://api.m3o.com/v1/db/Read

Read data from a table. Lookup can be by ID or via querying any field in the record.

Request payload

id string

Read by id. Equivalent to 'id == "your-id"'

limit number

Maximum number of records to return. Default limit is 25. Maximum limit is 1000. Anything higher will return an error.

offset number

order string

'asc' (default), 'desc'

orderBy string

field name to order by

query string

Examples: 'age >= 18', 'age >= 18 and verified == true' Comparison operators: '==', '!=', '<', '>', '<=', '>=' Logical operator: 'and' Dot access is supported, eg: 'user.age == 11' Accessing list elements is not supported yet.

table string

Optional table name. Defaults to 'default'

Response

records object array

JSON encoded records

Truncate Free

POSThttps://api.m3o.com/v1/db/Truncate

Truncate the records in a table

Request payload

table string

Optional table name. Defaults to 'default'

Response

table string

The table truncated

Update Free

POSThttps://api.m3o.com/v1/db/Update

Update a record in the database. Include an "id" in the record to update.

Request payload

id string

The id of the record. If not specified it is inferred from the 'id' field of the record

record object

record, JSON object

table string

Optional table name. Defaults to 'default'