Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save YuriGor/035fca75e53fd14204a3a4d44eee2f6a to your computer and use it in GitHub Desktop.
Save YuriGor/035fca75e53fd14204a3a4d44eee2f6a to your computer and use it in GitHub Desktop.
mongodb-memory-server doesn't work with mongodb v4 on Ubuntu 18.04 - https://github.com/nodkz/mongodb-memory-server/issues/89
$ node ./mongodb-memory-server-no4.js
3.6.3
--> b4 new MongodbMemoryServer.default..
--> b4 mongod.getConnectionString()..
[!] If you see this, then mongodb-memory-server works with mongo 3.6.3
stop 3.6.3
3.6.4
--> b4 new MongodbMemoryServer.default..
--> b4 mongod.getConnectionString()..
[!] If you see this, then mongodb-memory-server works with mongo 3.6.4
stop 3.6.4
3.6.5
--> b4 new MongodbMemoryServer.default..
--> b4 mongod.getConnectionString()..
[!] If you see this, then mongodb-memory-server works with mongo 3.6.5
stop 3.6.5
3.6.6
--> b4 new MongodbMemoryServer.default..
--> b4 mongod.getConnectionString()..
[!] If you see this, then mongodb-memory-server works with mongo 3.6.6
stop 3.6.6
3.6.7
--> b4 new MongodbMemoryServer.default..
--> b4 mongod.getConnectionString()..
[!] If you see this, then mongodb-memory-server works with mongo 3.6.7
stop 3.6.7
3.6.8
--> b4 new MongodbMemoryServer.default..
--> b4 mongod.getConnectionString()..
[!] If you see this, then mongodb-memory-server works with mongo 3.6.8
stop 3.6.8
4.0.0
--> b4 new MongodbMemoryServer.default..
--> b4 mongod.getConnectionString()..
const MongodbMemoryServer = require('mongodb-memory-server');
async function main(v) {
try{
console.log(v);
console.log("--> b4 new MongodbMemoryServer.default..");
var config = {
instance: {
dbName: 'run',
},
binary: {
version: v,
},
//debug: true,// add this to see errors
};
const mongod = new MongodbMemoryServer.default(config);
console.log("--> b4 mongod.getConnectionString()..");
const mongoUri = await mongod.getConnectionString();
console.log("[!] If you see this, then mongodb-memory-server works with mongo "+config.binary.version);
await mongod.stop();
console.log("stop "+config.binary.version);
}catch(err){
console.error("Something wrong with "+config.binary.version,err);
}
}
main('3.6.3')
.then(()=>{
return main('3.6.4');
})
.then(()=>{
return main('3.6.5');
})
.then(()=>{
return main('3.6.6');
})
.then(()=>{
return main('3.6.7');
})
.then(()=>{
return main('3.6.8');
})
.then(()=>{
return main('4.0.0');
})
.then(()=>{
return main('4.0.1');
})
.then(()=>{
return main('4.0.2');
})
.then(()=>{
return main('4.0.3');
})
.catch((err)=>{
console.log('oh noes');
})
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment