I am using the mongodb native driver for node.js and can\'t get to work the field selection. What I want to do is to limit fields to name. I do not want the \'last\' in the outp
If you are using latest mongodb 3.0 nodejs driver, then try this code:
db.collection('test').find({}).project({name: 1, last: 1}).toArray();