title: Mongodb word count using map reduce
body: <p>I have a problem with counting words
  I want to count word in projects.log.subject.
  ex) count [A],[B],[C]..
  I searched how to use map reduce.. but I don't understand how to use it for result i want.</p>
  
  <pre><code>{
  "_id": ObjectID("569f3a3e9d2540764d8bde59"),
  "A": "book",
  "server": "us",
  "projects": [
      {
          "domainArray": [
              {
                  ~~~~
              }
          ],
          "log": [
              {
                  ~~~~~,
                  "subject": "[A][B]I WANT THIS"
              }
          ],
          "before": "234234234"
      },
      {
          "domainArray": [
              {
                  ~~~~
              }
          ],
          "log": [
              {
                  ~~~~~,
                  "subject": "[B][C]I WANT THIS"
              }
          ],
          "before": "234234234"
      },....
  ] //end of projects
  }//end of document
  </code></pre>