2
と配列型のフィールドを除外するために、私はこのようなスキーマを持っている:私はコレクションにクエリを行うとはどのようにマングース
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}]
});
、フィールド画像は、まだ私はselect: false
を入れた場合でも表示されます。 .select('-images')
を使用せずにフィールドを非表示にするにはどうすればよいですか?
あなたの手で私たちのクエリを表示することができますか? – chridam
あなたは' City.find({}) {}、 'name region')sort( 'name')。lean()。exec(function(err、cities){console.log(cities);}) '? – chridam
可能な複製[select:falseをスキーマのサブ文書の配列に指定する](http://stackoverflow.com/questions/17374293/specifying-select-false-on-array-of-subdocuments-in-schema) –