title: (mongoose) put method does not work
body: <p>I am creating web API using mongoose.</p>
  
  <p>POST and GET work, but I have no idea how to implement PUT method in mongoose. </p>
  
  <p>Here is what I created:</p>
  
  <p>board.js</p>
  
  <pre><code>const mongoose = require('mongoose');
  const bcrypt = require('bcryptjs');
  const config = require('../config/database');
  
  const BoardSchema = mongoose.Schema({
      _id: {
          type: String
      },
      position: {
          type: [String]
      }
  });
  
  const Board = module.exports = mongoose.model('boards', BoardSchema);
  
  module.exports.getBoardById = function (id, callback)
  {
      Board.findById(id, callback);
  }
  
  module.exports.addBoard = function (newBoard, callback)
  {
      newBoard.save(callback);
  }
  
  module.exports.updateBoard = function (newBoard, callback)
  {
      newBoard.save(callback);
  }
  </code></pre>
  
  <p>users.js</p>
  
  <pre><code>router.put('/board/:id', (req, res, next) =&gt;
  {
      let newBoard = new Board({
          _id: req.params.id,
          position: req.body.position
      });
  
      Board.updateBoard(newBoard, (err, board) =&gt;
      {
          if (err)
          {
              res.json({ newBoard: newBoard, success: false, msg: "Failed to update board" });
          }
          else
          {
              res.json({ newBoard: newBoard, success: true, msg: "Board added" });
          }
      });
  });;
  </code></pre>
  
  <p>Here, in the board.js, I created methods for adding a new board and updating to existing board. .addBoard is working correctly and am able to test it using Postman. But, .updateBoard adds the data when the data does not exist, but does not update any data and returns false as response (just like POST does). Is there any way I can make the PUT method works? </p>
  
  <p>Thank you!</p>