我有猫鼬 Shcema:
Track = new Schema({ title: 'string', 艺术家: 'string' })
在我的数据库集合中,我有 object: { title: 'title1', artist: 'artist1', status: '1' }
状态不在模式中,但仍由 find 方法检索。我认为架构应该能够限制这一点。
是否可以通过 findOne 或 findById 等检索此对象,而无需自动排除状态属性而无需通过 {status: 0} 明确指出它?