title: Trying to query mongoose with variable as key
body: <p>How can I query mongodb using a variable as the key I'm searching for?</p>
  
  <p>The data:</p>
  
  <pre><code>const schedule = {
    day0: [10, 1440],
    day1: [10, 1440],
    day3: [10, 1440],
    day6: [10, 1440],
  }
  </code></pre>
  
  <p>The query</p>
  
  <pre><code>User.find({ `schedule.${varHere}` { $exists: true}}, (err, users) =&gt; {
    console.log(users)
  })
  </code></pre>