How to convert string to objectId in LocalField for $lookup Mongodb [duplicate] How to convert string to objectId in LocalField for $lookup Mongodb [duplicate] mongodb mongodb

How to convert string to objectId in LocalField for $lookup Mongodb [duplicate]


It's not possible in the aggregation pipeline. There is no method to convert the type.Can you change the type of "assignedId" in the Tasks collection to ObjectId ?Else you have to do it in code, convert the ObjectId to a String and use in in another query.