MongoClient 文档展示了如何使用 Server 实例来创建连接:
var Db = require('mongodb').Db,
MongoClient = require('mongodb').MongoClient,
Server = require('mongodb').Server;
// Set up the connection to the local db
var mongoclient = new MongoClient(new Server("localhost", 27017));
你如何为此指定用户名和密码?