Node JS Express MongoDB Encontre todos os documentos

//to get all the products
app.get("/products", async (req, res) => {
  try {
    const allProducts = await Product.find();
    return res.json(allProducts);
  } catch (error) {
    res.json({ message: error });
  }
});
Philan ISithembiso