title: What is this error "Cast to ObjectId failed for value "shop.css" (type string) at path "_id" for model "Product""?
body: <p>I am trying to extract detail of products entered by that administrator.</p>
  <p>Here is the part of code dealing with that:</p>
  <pre><code>router.get('/admin-product/:userid', (req, res, next)=&gt;{
      
      Product.find({_id: req.params.userid})    
             .then(prods=&gt;{
                  res.render('adminproduct', {
                      prods: prods, 
                      userid: req.params.userid, 
                      name:&quot;vinod&quot;
                  });
             })
             .catch(err=&gt;{
                 console.log(err);
             })
      
      
  })
  
  </code></pre>
  <p>But when i execute the code i get error as <code>Cast to ObjectId failed for value &quot;shop.css&quot; (type string) at path &quot;_id&quot; for model &quot;Product&quot;</code></p>
  <p>Guide me on what is causing this problem and how to eliminate it?</p>