title: how to make a mongoose query to search for matching arrays
body: <p>I am making a chat app where the user when first time sends a message to a person a new conversation is created in the database, But before creating a new one every time, I want to check whether the conversation exists, I'am building this in Node.js and using express framework &amp; I'am using Mongoose to handle the database </p>
  
  <pre><code>const mongoose = require('mongoose');
  
  const Conversation = new mongoose.Schema({
      Users : [
          {
              user_id : {
                  type : String,
                  required : true
              },
              username : {
                  type : String,
                  required : true
              },
              name : {
                  type : String,
                  required : true
              },
              profileUrl : {
                  type : String,
                  required : true
              }
          }
      ],
      createdAt : {
          type : Date,
          default : Date.now,
          required : true
      }
  
  });
  
  
  module.exports = mongoose.model("Conversation",Conversation); 
  </code></pre>
  
  <p>Is there a query where I can check if there is an conversation which matches with the array I'm passing, I couldn't find a way to search for array with objects and I want all the fields to be equal not just single one</p>