Hi,
I am stucking at get jsonb field from ecot query.
Here is the table
templates
Table "public.templates"
Column | Type | Collation | Nullable | Default
--------------+--------------------------------+-----------+----------+---------------------------------------
id | bigint | | not null | nextval('templates_id_seq'::regclass)
uuid | uuid | | not null |
name | character varying(255) | | |
state | character varying(255) | | |
expireDate | date | | |
templateData | jsonb | | |
surveys | jsonb | | |
Here is my survey data which is a array
[
{
"id": "44895bb7-440f-4802-abc4-78a5bae23570",
"data": {"age": 20, "name": "rose"},
"updated_at": "2020-10-16T03:16:58",
"inserted_at": "2020-10-16T03:16:58"
}, {
"id": "e24332e7-66d8-499c-8d49-7dfe564aa3ea",
"data": {"age": 20, "name": "jack"},
"updated_at": "2020-10-16T03:16:58",
"inserted_at": "2020-10-16T03:16:58"
}
]
I need a query which only return one survey which id == 44895bb7-440f-4802-abc4-78a5bae23570
Any idea about how to do this is pure sql or ecto?
Thanks