刚学mean,用monk连mongodb,find的第二个用来过滤键的参数为何无效
巴扎黑
巴扎黑 2017-04-25 09:03:31
0
1
602
    var collection=db.get("foo");
    collection.find({},{"name":0},function(e,docs){
        //TODO
    });

无论直接在前台看还是用调试工具看,name这个键都没有被过滤掉,是因为monk和原生的方法有什么不同还是别的什么原因?

巴扎黑
巴扎黑

reply all(1)
伊谢尔伦

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template