title: Mongoose saves just '_v' and '_id'
body: <p>I'm trying to add book to MongoDB and try to post with Postman it just saves _id and _v. I read a lot of answers here but neither was helpful. Get books works good but I inserted a book from command prompt.
  Is there any other method to save it ? </p>
  
  <p>Here is the code of api.js file:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>onst express = require('express');
  const router = express.Router();
  const mongoose = require('mongoose');
  
  var Book = require('../models/book');
  
  //MONGODB CONNECTION
  mongoose.connect('mongodb://127.0.0.1:27017/books' ,({useMongoClient: true}));
  
  mongoose.connection.on('connected', () =&gt; {
          console.log('Successfully connected to MongoDB');
  });
  
  mongoose.connection.once('error', (err) =&gt;{
          console.log('Error: '+ err);
  });
  
  //Get books
  router.get('/books', function(req, res) {
    Book.find(function(err, books) {
        if (err) {
            res.send(err);
           } else 
        res.json(books); 
    });
  });
  
  //Post books
  router.post('/books', (req,res) =&gt; {
      let newBook = new Book (req.body);
        newBook.name = req.body.name,
        newBook.author = req.body.author,
        newBook.pages = req.body.pages,
        newBook.save((err, newBook) =&gt; {
          if (err){
            console.log(err);
          } else {
            res.json(newBook);
          }
        });
  });
  
  module.exports = router;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is the code of the model file:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const mongoose = require('mongoose');
  var schema = mongoose.Schema;
  
  var bookSchema = new schema ({
      name: String,
      author: String,
      pages: Number
  });
  
  module.exports = mongoose.model('book', bookSchema, 'books');</code></pre>
  </div>
  </div>
  </p>
  
  <p>And code of the server file:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const express = require('express');
  const path = require('path');
  const bodyParser = require('body-parser');
  const mongoose = require('mongoose');
  const api = require('./server/routes/api');
  
  const app = express();
  
  
  //SERVER 
  
  const port = 3000;
  
  
  app.listen(3000, () =&gt; {
      console.log('Server started on port '+port)
  });
  
  // BODYPARSER
  
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({extended: true}));
  
  //API
  
  app.use('/api', api);
  
  
  // ROUTES
  
  app.use(express.static(path.join(__dirname, 'dist')));
  
  app.get('*', (req, res) =&gt; {
      res.sendFile(path.join(__dirname, 'dist/index.html'));
    });</code></pre>
  </div>
  </div>
  </p>