I have a really deep-nested JSON object generated by aggregation query, but I want to convert all the object ids to string format. Tried $toString in $addFields and $project. Since the object is nested and contains an array of objects with object id. It's difficult to do using this. Is there any other way by which I can convert all object ids to string in MongoDB during querying?
I have used the
$project operators to solve this. Although it took time. But the issue is resolved.