mongodb find return only one field code example
Example 1: mongodb select fields
db.inventory.find( { status: "A" }, { item: 1, status: 1 } )
Example 2: find only one field mongodb
db.students.find({}, {roll:1, _id:0})
db.inventory.find( { status: "A" }, { item: 1, status: 1 } )
db.students.find({}, {roll:1, _id:0})