从MongoDB和尚的结果中排除字段 [英] Exclude fields from result in MongoDB monk
本文介绍了从MongoDB和尚的结果中排除字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从结果中排除一些字段. 我有代码:
I want to exclude some fields from result. I have code:
users = db.select('users');
users.find( {}, { sort: { points:1 }, privateKey:0, publicKey:0}, function(err,data){
res.send(data);
});
我想从结果中排除私钥和公钥. 我可以和尚吗?
I want to exclude private and public key from results. Can I do that using monk?
推荐答案
您也可以这样:
users.find( {}, { sort: { points:1 }, fields : { privateKey:0, publicKey:0} },
function(err,data){
res.send(data);
}
);
这篇关于从MongoDB和尚的结果中排除字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文