title: How to get database value in json format
body: <p>I have the following code which gives <code>static data in json</code> :</p>
  
  <pre><code>var Movies0 = 
  [ 
   { 
    name: 'Once Upon a Time in the West',
    rating: '8.7',
    director: 'Sergio Leone',
    year: '1968',
    actor: 'Henry Fonda' 
   },
  
   { 
    name: 'Terminator 2: Judgment Day',
    rating: '8.6',
    director: 'James Cameron',
    year: '1991',
    actor: 'Arnold Schwarzenegger' 
   }
  ];
    var Movies = [Movies0];
  </code></pre>
  
  <p>i want this code to output data from my database rather then putting static value</p>