title: JSON to JSON mapping using Mustache
body: <p>I want to map my Input JSON with another JSON using <code>mustache</code>.</p>
  
  <p>My Input JSON is like:</p>
  
  <pre><code>{
    "data": [
      { "catalogId": "1850", "productId": "ELEC004A"},
      { "catalogId": "1851", "productId": "PNG679"}
    ]
  }
  </code></pre>
  
  <p>I want a template in which I could combine the mustache tags with my output json.</p>
  
  <pre><code>var template = JSON.stringify(
    {
      Product: [
        {{#data}}
        {
          productId:'{{productId}}',
          parentProductId:'{{catalogId}}'
        }
        {{/data}} 
      ]
    }
  );
  </code></pre>
  
  <p>I tried this but using mustache tag with JSON are giving me errors.
  I tried defining the template without using <code>JSON.stringify</code> but no luck!</p>
  
  <p>Have to use mustache only as it is the requirement, the actual input JSON is quite large and can't map it using the traditional way.</p>