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