这是我的程序依赖:MongoError:驱动程序与此服务器版本不兼容?
var express = require('express'),
app = express(),
cons = require('consolidate'),
MongoClient = require('mongodb').MongoClient,
mongodb = require('mongodb'),
Server = require('mongodb').Server;
var mongoclient = new MongoClient(new Server("localhost", 27017));
var db = mongoclient.db('prisync_mamy');
该查询在工作的NodeJS罚款蒙戈2.6
db.collection('coll').insert_one(documen , function(err , records){
if (err) throw err;
});
但当升级蒙戈2.6到3.x,然后提示错误:
MongoError: driver is incompatible with this server version at Object.toError (/home/ekodev/Documents/ComParice/node_modules/mongodb/lib/mongodb/utils.js:110:11) at __executeInsertCommand (/home/ekodev/Documents/ComParice/node_modules/mongodb/lib/mongodb/db.js:1829:27) at Db._executeInsertCommand (/home/ekodev/Documents/ComParice/node_modules/mongodb/lib/mongodb/db.js:1930:5) at insertAll (/home/ekodev/Documents/ComParice/node_modules/mongodb/lib/mongodb/collection/core.js:205:13) at Collection.insert (/home/ekodev/Documents/ComParice/node_modules/mongodb/lib/mongodb/collection/core.js:35:3) at app.get.pro_url (/home/ekodev/Documents/ComParice/app.js:72:47)
at callbacks (/home/ekodev/Documents/ComParice/node_modules/express/lib/router/index.js:164:37) at param (/home/ekodev/Documents/ComParice/node_modules/express/lib/router/index.js:138:11) at pass (/home/ekodev/Documents/ComParice/node_modules/express/lib/router/index.js:145:5) at Router._dispatch (/home/ekodev/Documents/ComParice/node_modules/express/lib/router/index.js:173:5)
请更新您的mongodb驱动程序 –
@AlokDeshwal现在我编辑了我的问题。哪一个我必须更新以及如何? –
您应该将node.js版本(最新版本的node.js)更新为错误状态,指出由于您已更新与节点js版本 –