I am working with MongoDB 3.6. I'm trying to do an aggregation $lookup as below.
$lookup
{
from: 'm_mtr',
localField: 'mtdid',
foreignField: '_id',
as: 'mm'
}
This doesn't work for me as 'mtdid' is a string with values like '5bdbe5bcff10z046fcf8f04a'and '_id' is an Object Id field with values like 'ObjectId('5bdbe5bcff10z046fcf8f04a')'.
Is there a way to convert string to ObjectId? I know this is possible in Mongodb 4.0. Unfortunately I don't have an option of using anything other than 3.6.