dburl = "mongodb://127.0.0.1:27017/demo";
db = require('mongojs').connect(dburl);
console.log(db.version);我想知道使用mongojs的mongodb版本。
发布于 2013-06-05 14:17:56
试试这个:
db.executeDbCommand({ buildInfo : 1 }, function(err, buildinfo) {
console.log('V', buildinfo.documents[0].version);
});编辑:使用command()的简化版本
db.command({ buildInfo : 1 }, function(err, buildinfo) {
console.log('V', buildinfo.version);
});要获取可以执行的命令列表,请执行以下操作:
db.command({ listCommands : 1 }, function(err, response) {
console.log(response.commands);
});https://stackoverflow.com/questions/16932460
复制相似问题