相关疑难解决方法(0)

mongoose.js 3:如何判断嵌套不是文档

我的猫鼬模式:

mongoose.Schema({
        title: 'string',
        items: [{
            uid: 'string',
            type: {type: 'string'},
            title: 'string',
            items: [{uid: 'string', type: {type: 'string'}, text: 'string'}]
        }]
    });
Run Code Online (Sandbox Code Playgroud)

如何告诉mongoose项目(和项目项目)不是文档,而只是嵌套对象?我既不需要_id属性也不需要任何文档的功能,但我想定义它们并使用模式进行限制.

_id: false够吗?

mongoose

1
推荐指数
1
解决办法
810
查看次数

标签 统计

mongoose ×1