title: How to find the data inside of array using mongoose
body: <p>I have a data like below in MongoDB.<br></p>
  
  <pre><code>const A = { uid: '1234',
              works: [
             { name: 'car',
               item:['tire','wheel']
             },
             { name: 'ship',
               item:['tire','wheel']
             }
             ]
  </code></pre>
  
  <p>My goal is to find whether the name duplicated exists or not.<br>
  In conclusion, I want to get only the names.<br>
  So 'res.send(result)' gives me like '[car, ship]'.
  But the code below doesn't work. How can I make that function? Thank you so much. </p>
  
  <pre><code>const workName = await User.findOne({
        uid: userID, works:{$in:['name']}
      });
  </code></pre>