title: Count fields in a MongoDB Collection
body: <p>I have a collection of documents like this one:</p>
  
  <pre><code>{
      "_id" : ObjectId("..."),
      "field1": "some string",
      "field2": "another string",
      "field3": 123
  }
  </code></pre>
  
  <p>I'd like to be able to iterate over the entire collection, and find the entire number of fields there are. In this example document there are 3 (I don't want to include _id), but it ranges from 2 to 50 fields in a document. Ultimately, I'm just looking for the average number of fields per document.</p>
  
  <p>Any ideas?</p>