获取您的 自有 Node 服务器
var MongoClient = require('mongodb').MongoClient;
var url = "mongodb://127.0.0.1:27017/mydb";

MongoClient.connect(url, function(err, db) {
  if (err) throw err;
  //Exclude "address" field in the result:
  db.collection("customers").find({}, { projection: { name: 1, address: 0 } }).toArray(function(err, result) {
    if (err) throw err;
    console.log(result);
    db.close();
  });
});

              
C:\Users\Your Name\node_modules\mongodb\lib\utils.js98
    process.nextTick(function() { throw err; });
                                  ^
MongoError: 投影不能同时包含包含和排除。
...