SchemaType.prototype.select()

Parameters
  • val «Boolean»
Returns:
  • «SchemaType» this

Sets default select() behavior for this path.

Set to true if this path should always be included in the results, false if it should be excluded by default. This setting can be overridden at the query level.

Example:

  1. T = db.model('T', new Schema({ x: { type: String, select: true }}));
  2. T.find(..); // field x will always be selected ..
  3. // .. unless overridden;
  4. T.find().select('-x').exec(callback);