node-object-mapper icon indicating copy to clipboard operation
node-object-mapper copied to clipboard

Add a section with examples

Open BarryRufer opened this issue 5 years ago • 2 comments

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
    }
  ]
}]

BarryRufer avatar Nov 08 '19 02:11 BarryRufer

Perhaps there is a way that we can implement a sandbox in jsfiddle or something similar?

switzer avatar Dec 18 '19 12:12 switzer

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 */}, ] }`

bladimir-villarreal avatar Nov 25 '20 15:11 bladimir-villarreal