Add JSON extraction example to README
commit3a6c57c14589019cb060347d2cae1940fca9b8cc
authorfabianlindfors <fabian@flapplabs.se>
dateTue 25 Jan 2022, 22:14 (5 years ago)
parentf6d6f28
README.md+15
@@ -317,6 +317,21 @@ column = "name"
317317down = "first_name || ' ' || last_name"
318318```
319319
320+*Example: extract nested value from unstructed JSON `data` column to new `name` column*
321+
322+```toml
323+[[actions]]
324+type = "add_column"
325+table = "users"
326+
327+# #>> '{}' converts the JSON string value to TEXT
328+up = "data['path']['to']['value'] #>> '{}'"
329+
330+ [actions.column]
331+ name = "name"
332+ type = "TEXT"
333+```
334+
320335
321336#### Alter column
322337