I have a schema like this:
var CitySchema = new Schema({
name: {type : String, required : true},
region: {type: Schema.Types.ObjectId, ref: 'Region', required : true},
images: [{type : Schema.Types.ObjectId, ref: 'Image', select: false}]
});
When I do query on the collection, the field images would still show up even when I put the select: false. How can I hide the field without using .select('-images')?
City.find({}).sort('name').lean().exec(function(err, cities) { console.log(cities); });City.find({}, 'name region').sort('name').lean().exec(function(err, cities) { console.log(cities); })?