I\'m working with Mongoose. I have seen a lot of developers make the following command:
mongoose.Promise = global.Promise;
Then I was curi
we used just in the point when we want to get connected in to MongoDB database :
var mongoose = require('mongoose');
var mongoDB = ' database url ';
mongoose.connect(mongoDB);
mongoose.Promise = global.Promise;
mongoose.connection.on('error',console.error.bind(console, 'MongoDB connection error:'));
you need to create schema and do your own model after