import Promise from 'bluebird';
import config from 'config';
import mongoose from 'mongoose';

mongoose.Promise = Promise;

if (process.env.NODE_ENV === 'test') {
    mongoose.connect('mongodb://localhost/test');
}
else {
    const servers = config.get('mongodb.servers') || ['localhost'];
    const replset = config.get('mongodb.replset') || null;
    mongoose.connect(servers.join(','), { replSet: { rs_name: replset } });
}

import Promise from 'bluebird';
import config from 'config';
import mongoose from 'mongoose';

mongoose.Promise = Promise;

if (process.env.NODE_ENV === 'test') {
    mongoose.connect('mongodb://localhost/test', { useMongoClient: true });
}
else {
    const servers = config.get('mongodb.servers') || ['localhost'];
    mongoose.connect(servers.join(','), { useMongoClient: true });
}

Fix deprecation warning about useMongoClient
Fix deprecation warning about useMongoClient
