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
The field selection argument to find is an object, not an array. And you can't mix field inclusion and exclusion (except for _id), so it should be:
find
_id
db.collection("test").find({}, {'name': true}).toArray(function(err, results) { console.dir(results); });