Commit 2d7aef4d authored by Girish Ramakrishnan's avatar Girish Ramakrishnan

mongo also break api

parent 59aa1f8d
......@@ -67,9 +67,10 @@ function populatePostgresql(callback) {
}
function populateMongodb(callback) {
mongoClient.connect(process.env.CLOUDRON_MONGODB_URL, function (error, db) {
mongoClient.connect(process.env.CLOUDRON_MONGODB_URL, function (error, client) {
if (error) return callback(error);
let db = client.db(process.env.CLOUDRON_MONGO_DATABASE);
db.createCollection('test', { strict: false }, function (error, collection) {
collection.insert({ 'cloudron': 'rocks' }, function (error) {
db.close();
......@@ -171,9 +172,10 @@ function checkPostgresql(callback) {
function checkMongodb(callback) {
console.log('Checking mongodb');
mongoClient.connect(process.env.CLOUDRON_MONGODB_URL, function (error, db) {
mongoClient.connect(process.env.CLOUDRON_MONGODB_URL, function (error, client) {
if (error) return callback(error);
var db = client.db(process.env.CLOUDRON_MONGO_DATABASE);
var collection = db.collection('test');
collection.findOne({ 'cloudron': 'rocks' }, function (error, item) {
db.close();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment