在风帆模型

时间:2015-07-31 16:55:54

标签: node.js mongodb model sails.js

我是帆船的新手。

在MongoDB中有一个选项,默认情况下可以排除属性。

例如

var Person = new Schema({ bio: { type: String, select: false },
                          other: {type:String, select:true }})
var P = db.model('Person', Person);
P.findOne(function (err, p) {
  console.log(p.bio) // undefined
  console.log(p.other) // it will get the data from database
});

如何在sails.js中设置此选项?

这可能吗?

我搜索过但没有得到任何答案。

0 个答案:

没有答案