猫鼬-如何在不插入的情况下获取模式的最终文档

时间:2018-09-09 13:37:59

标签: mongodb mongoose

说我有一个这样的模式。

{
    __content: {
        default: "",
        index: true,
        type: Mixed,
        validate: {
            validator(v)
            {
                return !!(
                    typeof v === "string" ||
                    (
                        typeof v === "object" &&
                        !Array.isArray(v)
                    )
                )
            }
        }
    },
    __hidden: {
        default: false,
        index: true,
        type: Boolean
    },
    __title: {
        required: true,
        index: true,
        type: String,
    },
    __type: {
        default: "text",
        enum: ["text", "table"],
        index: true,
        type: String
    },
}

如果我进行空白插入,是否可以返回模式的样子? Model.create({})没有实际插入?现在,我的想法是将其插入一次性收藏夹中并获得回报

0 个答案:

没有答案