【发布时间】:2013-05-15 10:57:14
【问题描述】:
我在 Jade 中有一个非常奇怪的问题,我无法访问架构中未定义的值。
我在我的架构上使用strict:false 并将值保存到其中。我的数据如下所示:
{
"title" : "This is a title in the schema",
"notInSchema" : "This will never show up"
}
这行得通:
h1= post.title
这不起作用:
h1= post.notInSchema
如果我将所有数据转储到模板中,我可以看到两条数据:
pre= JSON.stringify(options,null,'\t') //{"title" : "This is a title in the schema", "notInSchema" : "This will never show up"}
如果我将notInSchema 添加到我的架构中,它就会显示出来。我怎么能做到这一点而不添加它?
【问题讨论】:
标签: node.js mongodb express mongoose pug