var collection=db.get("foo");
collection.find({},{"name":0},function(e,docs){
//TODO
});
无论直接在前台看还是用调试工具看,name这个键都没有被过滤掉,是因为monk和原生的方法有什么不同还是别的什么原因?
伊谢尔伦2017-04-25 09:05:31
Try the method given in the official usage example:
collection.find({},'-name',function(e,docs){
//TODO
});
In addition, monk is a tool that is rarely used by people, so why not use mongoose? The usage is basically similar, and it is developed by the same team. It has richer functions, more people use it, and better community support. I suggest you give it a try.