我是新用mongoDB
,并NodeJS
和我有我的树莓派这个错误。但是,我在 Ubuntu 上运行它时没有任何错误。
这是我的代码:
var MongoClient = require("mongodb").MongoClient;
MongoClient.connect("mongodb://localhost/logs",{useUnifiedTopology : true},function(error,db) {
if(error) throw(error);
console.log("connected");
});
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
MongoServerSelectionError: Server at localhost:27017 reports maximum wire version 0, but this version of the Node.js Driver requires at least 2 (MongoDB 2.6)
at Timeout.waitQueueMember.timer.setTimeout [as _onTimeout] (/home/pi/monitoring/node_modules/mongodb/lib/core/sdam/topology.js:448:30)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决版本问题?谢谢
归档时间: |
|
查看次数: |
4144 次 |
最近记录: |