fluent-plugin-sql
fluent-plugin-sql copied to clipboard
How to Map a json inside a json to column
If I have a JSON {"id":7, "name":"bob"}, I can use column_mapping 'id:id, name:name' .
But, for example, I have a JSON like this : {"id":{"myid":7}, "name":"bob"}
How can I map myid to the column id?
use the trasnfrom record to extract the fields , then use the new vars to inster into the table
ex:
change record.to_json with record["filed"] or something like this, double check the ruby syntax
then in the table: