title: data is not saved in mongodb from express using mongoose
body: <p>This is my server:</p>
  
  <pre><code>const express = require('express');
  const bodyParser = require('body-parser');
  const pug = require('pug');
  const db = require('mongoose');
  const MongoClient = require('mongodb').MongoClient;
  db.Promise = global.Promise;
  var app = express();
  var Schema = db.Schema;
  var optionsdb = { promiseLibrary: require('bluebird') };
  
  //Conexion a MongoDB
  var connection = db.createConnection('mongodb://localhost/project', optionsdb, () =&gt; {
    console.log("Base de datos conectada")
  });
  
  
  var conn = db.connection;
  conn.on('error', console.error.bind(console, 'connection error:'));
  conn.once('open', function() {
    console.log('opened');
  });
  
  // connect to mongo function
  
  
  
  //Creacion de la Base de Datos en un JSON
  var usuarios = {
        email: String, 
        password: String,
      }
  
    //no tocar
  var db1;
  
  //Model 
  var user_schema = new Schema(usuarios);
  var User = db.model('User', user_schema);
  
  
      //vistas y configuracion
  app.set('view engine', 'pug')
  app.use(bodyParser.urlencoded({ extended: true }))
  app.use(express.static('public'));
  app.use(bodyParser.json());
  
  
  
  
  
       //peticiones HTTP
  app.get('/', (req,res) =&gt; {
    res.render('index');
    console.log('Hiciste una peticion GET');
  });
  
  app.get('/login', (req,res) =&gt; {
    res.render('login');
    console.log('Entraste al Login');
  });
  
  app.get('/register', (req,res) =&gt; {
    res.render('register');
    console.log('Entraste al Register');
  });
  
  
  app.post('/register', (req,res) =&gt; {
  
     var datos = new User({
          email: req.body.email,
          password: req.body.password
        }).save( (err,data) =&gt; {
          if(err){
            return err
          } else {
            console.log("datos enviados")
            res.render('bienvenido')
          }   
      })  
  
  });
  //Puerto en el que se va a escuchar el servidor
  app.listen(80, 'localhost', () =&gt; {
    console.log('Servidor iniciado correctamente');
  });
  </code></pre>
  
  <p>and I don't know why, when I do a POST require, this POST petittion:</p>
  
  <pre><code>app.post('/register', (req,res) =&gt; {
         var datos = new User({
              email: req.body.email,
              password: req.body.password
            }).save( (err,data) =&gt; {
              if(err){
                return err
              } else {
                console.log("datos enviados")
                res.render('bienvenido')
              }   
          })  
  </code></pre>
  
  <p>12/5000</p>
  
  <p>Nothing happens. The console does not show me any errors. I login but do not send the data, it does not redirect me to the page and it does not show me any errors in console. The page remains loading.</p>