title: {"index": 0,"code": 11000,"keyPattern": {"Name": 1}, "keyValue": { "Name": null }} error on adding second product to database
body: <p>On trying to add a product to my database using the following method,</p>
  <pre><code>//ADD PRODUCT
  router.post(&quot;/addproduct&quot;, verifyTokenAndAdmin, async (req, res) =&gt; {
    const newProduct = new Product(req.body);
  
    try {
      console.log(&quot;req for pdt add&quot;);
      const savedProduct = await newProduct.save();
      console.log(&quot;pdt added successfully&quot;);
      res.status(200).json(savedProduct);
    } catch (err) {
      res.status(500).json(err);
    }
  });
  </code></pre>
  <p>Mongoose is throwing this error when adding the second product. The first product is successful always but cannot make a second post request and also put request to update the product details is not working, but the delete request works perfectly fine</p>
  <pre><code>{
      &quot;index&quot;: 0,
      &quot;code&quot;: 11000,
      &quot;keyPattern&quot;: {
          &quot;Name&quot;: 1
      },
      &quot;keyValue&quot;: {
          &quot;Name&quot;: null
      }
  }
  </code></pre>
  <p>Given below is my product schema</p>
  <p>const { default: mongoose } = require(&quot;mongoose&quot;);</p>
  <pre><code>const ProductSchema = new mongoose.Schema(
    {
      title: { type: String, required: true, unique: true },
      desc: { type: String, required: true },
      img: { type: String, required: true },
      category: { type: Array, required: true },
      size: { type: String },
      color: { type: String },
      price: { type: Number, required: true },
    },
    { timestamps: true }
  );
  
  module.exports = mongoose.model(&quot;Product&quot;, ProductSchema);
  </code></pre>