Replies: 1 comment
-
(Sorry for late reply. Also converted this to a discussion.) Assuming a table created like this: create table t1 (at timestamptz default current_timestamp, data jsonb); Here is a RapidRows configuration yaml: version: '1'
endpoints:
- uri: /report-data
implType: exec
datasource: default
script: INSERT INTO t1 (data) VALUES ($1::jsonb)
params:
- name: data
in: body
type: string
required: true
datasources:
- name: default
dbname: mdevan You can POST to the endpoint like so:
with a result like:
Is this what you want to do? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have following data posted as a json and I want it to put into a single jsonb field.
How can I achieve that?
[
{
"sensors": [
{
"type": "air_sensor",
"temperature": 2,
"humidity": 45,
"code": "dht11",
"id": 10001
},
{
"type": "soil_sensor",
"soil_moisture": 354,
"code": "EIS10698",
"id": 10002
}
],
"id": "324sre43bv5345v45v346tvb3",
"mac": "..."
}
]
Beta Was this translation helpful? Give feedback.
All reactions