title: How do i get all keys in Mongodb collection?
body: <p>I saw few solutions but those are not exact my solution. I have a DB with name results and collection name is marks like below:</p>
  
  <pre><code>db.marks.find();
  { "_id" : ObjectId("54f57522627af4bfdcf79764"), "name" : "John", "scroe1" : 23, "score2" : 21, "score5" : 12 }
  { "_id" : ObjectId("54f5761a627af4bfdcf79765"), "name" : "Mike", "scroe2" : 22, "score3" : 20, "score4" : 22 }
  { "_id" : ObjectId("559d0bc521cb2e056507c3e3"), "name" : "Bush", "score2" : 30 }
  </code></pre>
  
  <p>I tried with</p>
  
  <pre><code>var doc=db.marks.findOne(); for (var key in doc) print(key);
  </code></pre>
  
  <p>and i got</p>
  
  <pre><code>_id
  name
  score1
  score2
  score5
  </code></pre>
  
  <p>But i Want all keys in collection like below:</p>
  
  <pre><code>_id, name, score1, score2, score3, score4, score5
  </code></pre>
  
  <p>name
  scroe1
  score2
  score3here</p>