Node.js “正在通过”;安全=正确”;在mongo连接字符串中,相当于在回调选项中传递它
连接字符串中的passing Safe=trueNode.js “正在通过”;安全=正确”;在mongo连接字符串中,相当于在回调选项中传递它,node.js,mongodb,Node.js,Mongodb,连接字符串中的passing Safe=true mongoClient.connect("mongodb://localhost:27017/MyDatabaseName?Safe=true", function (err, db) { var collection = db.collection("someCollection"); collection.insert(item, function(err, result){ }); } 相当于: mongoClie
mongoClient.connect("mongodb://localhost:27017/MyDatabaseName?Safe=true", function (err, db) {
var collection = db.collection("someCollection");
collection.insert(item, function(err, result){
});
}
相当于:
mongoClient.connect("mongodb://localhost:27017/MyDatabaseName", function(err, db) {
var collection = db.collection("someCollection");
collection.insert(item,{safe:true}, function(err, result){
});
}
你不知道吗?