En el siguiente código:
var mongoose = require('mongoose');
var mongoDB = 'mongodb://localhost/red_bicicletas';
mongoose.connect(mongoDB, {useNewUrlParser: true });
mongoose.Promise = global.Promise;
var db = mongoose.Connection;
db.on('error', console.error.bind(console, 'MongoDB connection error'));
TypeError: db.on is not a function