0.0.1 • Published 4 years ago

mongo-datalake v0.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

datalake

Persist arbitrary data

Writing Data

Data is stored in "droplets", which are blobs of similar data entries.

You can persist a single datapoint by POSTing it to the base url of the service:

{
  "droplet": "temperature",
  "data": {
    "timestamp": "2020-02-23T13:17:48+00:00",
    "value": 23.1
  }
}

This will create the droplet if it does not exist, or append the data to a droplet that already exist.

Alternatively, you can add multiple datapoints in a droplet like this:

{
  "droplet": "temperature",
  "data": [
    {
      "timestamp": "2020-02-23T13:17:00+00:00",
      "value": 23.1
    },
    {
      "timestamp": "2020-02-23T13:18:00+00:00",
      "value": 23.2
    }
  ]
}

Reading Data

Droplets are exposed as a RESTful ressource, relative to the base url of the server.

To list all droplets, you can GET the /droplets ressource:

["temperature", "waterlevel"]

To give an example: The temperature droplet is accessable via

GET /droplets/temperature