title: mongodb group values by multiple fields
body: <p>For example, I have these documents:</p>
  
  <pre><code>{
    "addr": "address1",
    "book": "book1"
  },
  {
    "addr": "address2",
    "book": "book1"
  },
  {
    "addr": "address1",
    "book": "book5"
  },
  {
    "addr": "address3",
    "book": "book9"
  },
  {
    "addr": "address2",
    "book": "book5"
  },
  {
    "addr": "address2",
    "book": "book1"
  },
  {
    "addr": "address1",
    "book": "book1"
  },
  {
    "addr": "address15",
    "book": "book1"
  },
  {
    "addr": "address9",
    "book": "book99"
  },
  {
    "addr": "address90",
    "book": "book33"
  },
  {
    "addr": "address4",
    "book": "book3"
  },
  {
    "addr": "address5",
    "book": "book1"
  },
  {
    "addr": "address77",
    "book": "book11"
  },
  {
    "addr": "address1",
    "book": "book1"
  }
  </code></pre>
  
  <p>and so on.<br><br><br>How can I make a request, which will describe the top N addresses and the top M books per address?<br><br>Example of expected result:<br><br> address1 | book_1: 5<br>          | book_2: 10<br>          | book_3: 50<br>          | total: 65<br> ______________________<br> address2 | book_1: 10<br>          | book_2: 10<br>          |...<br>          | book_M: 10<br>          | total: M*10<br>...<br> ______________________<br> addressN | book_1: 20<br>          | book_2: 20<br>          |...<br>          | book_M: 20<br>          | total: M*20</p>