let totalProducts = await RentedProducts.find({
customer: req.params.id,
}).project({ barcodes: 1 })
I just want to fetch the barcodes field but It is giving an error.
TypeError: RentedProducts.find(...).project is not a function
I have also installed MongoDB nodejs driver:
"mongodb": "^3.6.3",
How to use .project() for minimizing the bandwidth by reducing the number of fields on return.