addFields vs project mongodb code example
Example 1: mongodb project all fields
db.collection.aggregate([
{ "$addFields": { "custom_field": "$obj.obj_field1" } }
])
Example 2: mongodb aggregate remove field
{ $project: { "<field1>": 0, "<field2>": 0, ... } } // Return all but the specified fields