MongoDB 4.0 aggiunge $convert e l’alias $toString, che permettono di convertire _id in stringa.
db.getCollection('example').aggregate([
{ "$match": { "example": 1 } },
{ "$project": { "_id": { "$toString": "$_id" } } }
])In alternativa puoi trasformare i documenti nel cursore con .map().
db.getCollection('example').find().map(d => Object.assign(d, { _id: d._id.valueOf() }))