title: MongoDB: how to count number of keys in a document?
body: <p>Lets say a document is : </p>
  
  <pre><code>{
  
  a: 1,
  b: 1,
  c: 2,
   ....
  z: 2
  }
  </code></pre>
  
  <p>How can I count the number of keys in such document?  </p>
  
  <p>Thank you</p>