title: Make dynamic query with Mongoose
body: <p>I am trying to make a dynamic condition using Mongoose but it doesn't work as I imagined.</p>
  
  <p>the code is like this</p>
  
  <pre><code>id = req.params.questionId;
  index = req.params.index;
  
  callback = function(err,value){
     if(err){
  
         res.send(err)
  
     }else{
  
         res.send(value)
  
      }
  };
  
  conditions = {
      "_id": id,
      "array._id": filterId
  };
  updates = {
     $push: {
        "array.$.array2."+index+".answeredBy": userId
     }
  };
  options = {
    upsert: true
  };
  
  Model.update(conditions, updates, options, callback);
  </code></pre>
  
  <p>As you see, I am trying to make dynamic condition using "index" variable. Is it possible to do like this?</p>
  
  <p>Thank you in advance!</p>