title: How can I print document in cursor.ForEach?
body: <p>I've defined some simple cursor as find() on some collection.</p>
  
  <pre><code>cursor = db.students.find()
  </code></pre>
  
  <p>Student has following schema:</p>
  
  <pre><code>"_id" : 19,
  "name" : "Gisela Levin",
  "scores" : [
          {
                  "type" : "exam",
                  "score" : 44.51211101958831
          },
          {
                  "type" : "quiz",
                  "score" : 0.6578497966368002
          },
          {
                  "type" : "homework",
                  "score" : 93.36341655949683
          },
          {
                  "type" : "homework",
                  "score" : 49.43132782777443
          }
  ]
  </code></pre>
  
  <p>I want to iterate cursor and print a document. I try like that:</p>
  
  <pre><code>cursor.forEach(function(o){print(o)})
  </code></pre>
  
  <p>It prints only this:</p>
  
  <blockquote>
    <p>[object Object]</p>
  </blockquote>
  
  <p>If I modify a loop to select some simple property it works:</p>
  
  <pre><code>cursor.forEach(function(o){print(o._id)})
  </code></pre>
  
  <p>Though if I change it to print scores it prints this:</p>
  
  <pre><code>[object Object],[object Object],[object Object],[object Object]
  </code></pre>
  
  <p>Is there any function to print a json document in mongodb shell?</p>