如果您想使用 Node JS 实时推送某些内容,Mongo DB 和 Express 是否足以作为连接到 Mongo DB 的安全方式?
有人可以从安全角度解释这段代码吗?
===
很多教程只是使用...
var mongoClient = new MongoClient(new Server('localhost', 27017));
Mongos 文档包括...
var MongoClient = require('mongodb').MongoClient;
// Connect to the db
MongoClient.connect("mongodb://localhost:27017/exampleDb", function(err, db) {
if(!err) {
console.log("We are connected");
}
});
===
代码基于 Mongo 文档 - http://mongodb.github.io/node-mongodb-native/api-articles/nodekoarticle1.html#getting-that-c onnection-to-the-database