I'm using express-xml-bodyparser in NodeJs and I have this in app.post("/fdsfdsfds", function (req, res, nxt)
> req.body
{ my_obj: { var1: [ [Object] ] } }
> req.body.my_obj
{ var1:
[ { var2: [Object],
var3: [Object],
var1_code: [Object],
email: [Object] } ] }
> req.body.my_obj.var1
[ { var2: [ [Object] ],
var3: [ 'fdsfdsfdsfds' ],
var1_code: [ '14' ],
var4: [ 'test2' ],
useame: [ [Object] ],
email: [ 'fdsfdsfds' ] } ]
> req.body.my_obj.var1[0]
{ var2: [ { '$': [Object] } ],
var3: [ 'fdsfdsfdsfds' ],
var1_code: [ '14' ],
var4: [ 'test2' ],
useame: [ { '$': [Object] } ],
email: [ 'fdsfdsfds' ] }
I want to insert it into a db, therefore I have to create a dictionary. Is there any way to do that easily from what I have? This object has plenty of nested and redundant properties. As one of the options, I want to unfold them.
