Mongoose positional operator errors

醉酒当歌 提交于 2019-12-06 08:56:54

I had similar issue with mongoose also, maybe edit your post to see the schema. I fixed my problem by doing the following modification in my schema:<

var Result = new Schema({

    id                : Number,
    detailResult   : [detailRef], 
    simpleResult   : [{id: ObjectId, unit: String, value: Number, completed: Boolean}]
});

Notice in the working example (below), I added new mongoose.Schema()

var Result = new Schema({

    id                : Number,
    detailResult   : [detailRef], 
    simpleResult   : [new mongoose.Schema({id: ObjectId, unit: String, value: Number, completed: Boolean})]
});

You probably need to do this modification to your playlist embeddedDoc parameter in your schema.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!