title: Is it possible to insert and use JSON formatted javascript variables into MongoDB?
body: <p>I'm trying to format a huge js file so I can insert it into a MongoDB collection and read it via AJAX but I'm having trouble with the syntax.  It goes something like this:</p>
  
  <pre><code>var MyVariable1 = [ { 
    ThingsToGet: [ 
    { 
       first_thing: "SOMETHING ONE",
       second_thing: [[1, 0], [2, 0], [3, 4], [4, 4], [5, "x"], [6, "x"]]
       third_thing: 0,
       fourth_thing: []
       },{ 
       first_thing: "SOMETHING TWO",
       second_thing: [[1, 0], [2, 5], [3, 4], [4, 4], [5, "x"], [6, "x"]],
       third_thing: 0,
       fourth_thing: []
       },{ 
       first_thing: "SOMETHING THREE",
       second_thing: [[1, 0], [2, 0], [3, 4], [4, 4], [5, 2], [6, 2]],
       third_thing: 0,
       fourth_thing: []
       },
     ]
     }
   ];
  
  
   var MyVariable2 = [ { 
       ThingsToGet: [ etc, etc, etc...
  </code></pre>
  
  <p>I plan on querying it with PHP:</p>
  
  <pre><code>$variable_to_send_to_jquery = "MyVariable1";
  
  $filter = array(
      'var'=&gt;"MyVariable1";
  );
  
  
  $results = $collection-&gt;findone($filter);
  </code></pre>