Skip to content

Instantly share code, notes, and snippets.

@sm-a
Created May 6, 2019 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sm-a/b349ef8968db02ee553528c3e3559ad1 to your computer and use it in GitHub Desktop.
Save sm-a/b349ef8968db02ee553528c3e3559ad1 to your computer and use it in GitHub Desktop.
router.get('/brand/:smabrand', function(req, res) {
const smaquery = req.query;
// [..]
let getProductCount=async function(smaquery){
let count= await Products.countDocuments(smaquery);
console.log(count)
if (count === 0) {
return res.send("Brand not found!");
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment