title: Find and replace a sub sub array element in MongoDB
body: <p>Hi I am developing MeteorJS app, I am stuck at updating a sub sub array element.</p>
  
  <p>It is a poll application and I have the following database structure:</p>
  
  <p>Under each question there are options and when a user clicks a button of an option, I want to increment that options votes by one and every user should have one vote right for each question.</p>
  
  <p>From the button, I am passing name and questionId data in order to find the right option to increment vote. I should find the specific question with the questionId and then the specific array with the name under the Options.</p>
  
  <p>Where I am stuck at is I can't find it.</p>
  
  <p>Please help, thanks</p>
  
  <p>Collection Name: Polls</p>
  
  <p>Each Poll has the following structure:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
      "_id" : "uJtBt8mM2pbTYfwND",
      "createdAt" : ISODate("2017-04-03T22:40:14.678Z"),
      "pollName" : "First Poll",
      "entryOwner" : "gdAHxDrxFuTvYiFt8",
      "question" : [ 
          {
              "name" : "Question number 1",
              "questionId" : "xgYQxGxpwBXaQpjXN",
              "options" : [ 
                  {
                      "name" : "John",
                      "votes" : 0
                  }, 
                  {
                      "name" : "Adam",
                      "votes" : 0
                  }, 
                  {
                      "name" : "Robert",
                      "votes" : 0
                  }
              ]
          }, 
          {
              "name" : "Question number 2",
              "questionId" : "zviwYHHsaATBdG6Jw",
              "options" : [ 
                  {
                      "name" : "John",
                      "votes" : 0
                  }, 
                  {
                      "name" : "Adam",
                      "votes" : 0
                  }, 
                  {
                      "name" : "Robert",
                      "votes" : 0
                  }
              ]
          }
      ],
  }</code></pre>
  </div>
  </div>
  </p>