title: Mongoose: How to update value in array at index given from variable?
body: <p>options.votes is an array. </p>
  
  <p>This code works:</p>
  
  <pre><code>Poll.findOneAndUpdate({title},{$inc:{'options.votes.0':1}}
  </code></pre>
  
  <p>I need to replace 0 for a variable.</p>
  
  <p>This does not work:</p>
  
  <pre><code>const query = 'options.votes.'+variable
  Poll.findOneAndUpdate({title},{$inc:{query:1}}
  </code></pre>
  
  <p>Thanks for help</p>