I have a collection named Releases that holds a subdocument named product. My collection looks like this:
{
\"_id\": ObjectId(\"5b1010e4ef2afa6e5edea0c2\"),
\
You need to change your id
from string to mongoose objectId
var id = req.body.productId
var query = {'product._id' : mongoose.Types.ObjectId(req.body.productId)};
Release.find(query)
.select('_id version description product releasedate')
.sort({releasedate: 1 })
.exec()
.then(releases => {
console.log(releases);
res.status(200).json(releases);
})