title: Extract array to JSON
body: <p>I have a query that extracts a document with a username and password as a filter. My return value is an array (It will return the elements in phoneBook). How do I turn this into a JSON object? Just returning a JSON from a query would be ideal.</p>
  
  <pre><code> db.users.find({userName:"mark", passWord:"test1234"}, {phoneBook:1,_id:0})
  { "phoneBook" : [   {   "firstName" : "Rupert",     "lastName" : "Styx", "phoneNumber" : "9147388152",  "email" : "ruperstyx@gmail.com" } ] }
  </code></pre>
  
  <p>I'm still playing around with this string. I can't extract the attributes inside of phoneBook and turn it into a JSON</p>