I have json I get from a web server:
[{“orodrNum”:“1742997”,“orinv”:“1767409”,“orseq”:" “,“orbdat”:“2020-01-02”,“orbamt”:“1033.01”,“ortamt”:“1033.01”,“orblst”:“Y”,“orarst”:“1”,“orfsc”:“146.41”,“ortfsc”:“146.41”,“orbint”:“SMO”},{“orodrNum”:“1745954”,“orinv”:“1767454”,“orseq”:” “,“orbdat”:“2020-01-02”,“orbamt”:“2357.45”,“ortamt”:“2357.45”,“orblst”:“Y”,“orarst”:“1”,“orfsc”:“526.41”,“ortfsc”:“526.41”,“orbint”:“BRJ”},{“orodrNum”:“1747279”,“orinv”:“1767450”,“orseq”:” “,“orbdat”:“2020-01-02”,“orbamt”:“4419.60”,“ortamt”:“4419.60”,“orblst”:“Y”,“orarst”:“1”,“orfsc”:“658.80”,“ortfsc”:“658.80”,“orbint”:“BRJ”},{“orodrNum”:“1747479”,“orinv”:“1767606”,“orseq”:” “,“orbdat”:“2020-01-02”,“orbamt”:“2872.05”,“ortamt”:“2872.05”,“orblst”:“Y”,“orarst”:“1”,“orfsc”:“560.40”,“ortfsc”:“560.40”,“orbint”:“EVS”},{“orodrNum”:“1747809”,“orinv”:“1767605”,“orseq”:” ",“orbdat”:“2020-01-02”,“orbamt”:“1228.78”,“ortamt”:“1228.78”,“orblst”:“Y”,“orarst”:“1”,“orfsc”:“98.22”,“ortfsc”:“98.22”,“orbint”:“EVS”}]
And I want to create a new Order for each json object using Ecto (postgres) with a changeset.
How do I iterate/enum/map through the data? I currently have Poison to decode/parse but I’m not married to it or anything really. I just want take each of these orders from the json that comes from the webserver and store it as a row in the postgres db.