how to find document and print certain field only mongodb code example
Example: get only some fields of document in mongodb
db.student.find({}, {roll:1, _id:0})
same as SELECT roll FROM student
db.student.find({}, {roll:1, _id:0})
same as SELECT roll FROM student