title: How to make constant and variable mix query for nodejs and mongodb
body: <p>I am in bit of situation where i have to make field name dynamic consisting of variable and some constant. I do know how to use just variable to make field name.</p>
  
  <pre><code>var index = parseInt(req.body.index);
  db.collection("user_data").update(
   { "user_id": user_id }, 
   { $addToSet: { "share.index.comment": usr_data } }, 
   function (err, result) {
  </code></pre>
  
  <p>as here in field space i want to use index variable with constant share and comment</p>