node-object-mapper
node-object-mapper copied to clipboard
Add a section with examples
Hello.
Need more examples.
"results": [{
"books": [{
"part": 1,
"chapters": [
{
"chapter": 1
}, {
"chapter": 2
}, {
"chapter": 3
}
]
}]
}]
how to edit
"results": [{
"books": [
{
"part": 1,
"chapter": 1
}, {
"part": 1,
"chapter": 2
}, {
"part": 1,
"chapter": 3
}
]
}]
Perhaps there is a way that we can implement a sandbox in jsfiddle or something similar?
Please, better examples of working with arrays and append items to an existing array, the example in the documentations it's very simple and i can't understand how use it
`{ "sourceArray[]": { "key": "destination[]+", "transform": (val) => mappingFunction(val) }, "otherSourceArray[]": { "key": "destination[]+", "transform": (val) => mappingFunction(val) } }
// Results in the destination array appending the source values { "destination": [ {/*Results from the mapping function applied to sourceArray */}, {/*Results from the mapping function applied to otherSourceArray */}, ] }`