Mongoose 在架构中的子文档数组上指定select:false
我正在寻找有关关闭select of property(子文档数组)的正确语法的帮助。我希望有这样的东西:Mongoose 在架构中的子文档数组上指定select:false,mongoose,Mongoose,我正在寻找有关关闭select of property(子文档数组)的正确语法的帮助。我希望有这样的东西: var UserSchema = new Schema( { fb_id : Number, children : [{ type: CustomChildSchema,select:false}] } ) childrenarray具有指数增长的潜力,因此除非明确要求,否则我会尽量避免查询结果中出现这些内容 我提出
var UserSchema = new Schema(
{
fb_id : Number,
children : [{ type: CustomChildSchema,select:false}]
}
)
children
array具有指数增长的潜力,因此除非明确要求,否则我会尽量避免查询结果中出现这些内容 我提出了一个类似的问题,并使用下面稍加修改的语法解决了它
var UserSchema = new Schema(
{
fb_id : Number,
children : { type: [CustomChildSchema], select:false}
}
)
你找到解决办法了吗?你用的是哪种版本的猫鼬?