title: Finding data from mongodb with variable
body: <pre><code>db.collection('practice').find({"key":obj})
  </code></pre>
  
  <p><code>obj</code> is the value of an input box. When I <code>console.log(obj)</code> I get its value but when I use it in this function it doesn't find anything. When I do <code>find({})</code> it returns my whole database so I know it's working. Just wondering how to list the variable so it only finds the data with the obj name. </p>
  
  <p>example of working JSON:   </p>
  
  <pre><code>[{"_id":"5b9d1e06b355f116cb8cf0bb","key":"John"}]
  </code></pre>
  
  <p>The "John" comes from what I typed into the input box. If I typed a different name it would look like {"key" : "different name"}. This part works fine. The problem is that I want to then use this obj variable to find all the data that is equal to the obj variable. For example, if I typed in John, it would show me only where the key = john.</p>