title: Mongoose find value in each object in array for stored document
body: <p>I try to find refs I've stored in my db by sending an array of object to my API.
  In the array I send there are 4 objects. 2 of them are already stored, 2 of them are new.</p>
  <p>Here is what is stored in my DB:</p>
  <pre><code>[
    {
      ref: 'xxx14-010-S',
      colorWay: 'Black',
    },
    {
      ref: 'xxx18-050-S',
      colorWay: 'Black',
    },
  ...
  ]
  </code></pre>
  <p>My req.body look like this :</p>
  <pre><code>[
    {
      ref: 'xxx14-010-S',
      colorWay: 'Black',
    },
    {
      ref: 'xxx18-050-S',
      colorWay: 'Black',
    },
    {
      ref: 'xxx20-010-S',
      colorWay: 'Black',
    },
    {
      ref: 'xx324-010-S',
      colorWay: 'Black',
    }
  ]
  
  </code></pre>
  <p>And here is the code in my express router:</p>
  <pre><code>router.post(&quot;/api/v1/lineList&quot;, async (req, res, next) =&gt; {
    try {
      const existingRefs = await LineList.find({ref: {$in: req.body.ref}});
      res.send(existingRefs);
    } catch (err) {
      next(err);
    }
  });
  </code></pre>
  <p>This returns an empty array where I expect to find the 2 stored objects.
  How shall I proceed ?
  Is there a way to get the 2 found objects and also be notified that the 2 other object where not in the db ?</p>
  <p>Thanks a lot !</p>
  <p>EDIT:
  Here is the model:</p>
  <pre><code>const lineListSchema = new mongoose.Schema({
    ref: {
      type: String,
      required: true,
      unique: true,
      trim: true,
      uppercase: true,
    },
    styleName: {
      type: String,
      required: true,
      trim: true,
      uppercase: true,
    },
    colorWay: {
      type: String,
      required: true,
      trim: true,
      uppercase: true,
    },
   ...
    createdAt: {
      type: Date,
      default: Date.now,
      expires: 3600,
    },
  });
  </code></pre>