LearnBoost/mongoose — pull request #946 by aheckmann (2012-06-02 00:57:11+00:00)
Title: added; inclusion of deselected schema paths

In the schema, we may have set a default selection for
a given path through the `select` option.

new Schema({
name: 'string'
, path: { type: 'string', select: false }
})

In this case we always want to exclude this path by default.

It is often desirous to retreive the document including the
previously excluded path. Previously this involved manually
selecting all fields.

Thing.find().select('path name').exec(callback)

This commit introduces the `+` prefix during field selection which
forces inclusion of the specified path, overriding the schema
option. So now we only need specify the path to include and
leave the others out as implied inclusives.

Thing.findOne().select('+path').exec(function (err, doc) {
console.log(doc); // { name: 'Oz', path: 'Yellow Brick'}
});

closes #786