mongo select field with project code example
Example 1: mongodb select fields
db.inventory.find( { status: "A" }, { item: 1, status: 1 } )
Example 2: mongodb project all fields
db.collection.aggregate([
{ "$addFields": { "custom_field": "$obj.obj_field1" } }
])