title: How to store highcharts compatible json array data in mongodb
body: <p>I am trying to feed data to highcharts client. Currently highcharts expects data in below format. </p>
  
  <pre><code>    [
      [1515122457593,47,64.17,12.77,23.91,15969798], 
      [1515122497615,23.91,47.97,14.19,30.81,15969798],     
      [1515122537619,30.81,49.42,13.34,27.76,15969798],...
      ]
  </code></pre>
  
  <p>However, I could not find a way to store in same format in MongoDB. I think one possibility is as below. </p>
  
  <pre><code>{
  { "_id": 1, "time":1515122457593, "O":47, "H":64.17, "L":12.77, "C":23.91, "V":15969798 },
  { "_id": 2, "time":1515122497615, "O":23.91, "H":47.97, "L":14.19, "C":30.81, "V":15969798 },
  { "_id": 3, "time":1515122537619, "O":30.81, "H":49.42, "L":13.34, "C":27.76, "V":15969798 },
  ...
  }
  </code></pre>
  
  <p>My questions are in both directions.
  Direction 1: How do I make above mongodb friendly json format to be read by Highcharts OHLC. 
  Direction 2: How do I store Highcharts friendly data series in Mongodb? </p>
  
  <p>Kindly share example as I could not find online any snippets that could help and all my trials are in vain. I got a <a href="http://jsfiddle.net/gh/get/jquery/1.7.1/highslide-software/highcharts.com/tree/master/samples/highcharts/series/data-array-of-objects/" rel="nofollow noreferrer">hint</a> here, but could not develop it further for my OHLC format (I am newbie to JS and webdev)</p>
  
  <pre><code>Highcharts.chart('container', {
  chart: {
      type: 'column'
  },
  
  xAxis: {
      categories: ['Green', 'Pink']
  },
  
  series: [{
      data: [{
          name: 'Point 1',
          color: '#00FF00',
          y: 1
      }, {
          name: 'Point 2',
          color: '#FF00FF',
          y: 5
      }]
  }]});
  </code></pre>