title: Mongodb/Node.js findByIdAndUpdate method not updating
body: <p>I am trying to update a collection in my mongo database using the findByIdAndUpdate method. I hit the endpoint and the request with the updated information gets sent, by the response is always the information before the update and the update never appears in my database.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Below is my edit.js file:</p>
  
  <pre><code>const express = require('express');
  const bodyParser = require('body-parser');
  const _ = require('lodash');
  const dbConfig = require('../mongo/dbConfig');
  const Band = require('../mongo/models/band');
  const mongoose = require('mongoose');
  
  
  // Initialize the router
  const router = express.Router();
  mongoose.connect(dbConfig.devUrl);
  
  //init body parser
  router.use(
    bodyParser.urlencoded({
      extended: true
    })
  );
  
  router.use(bodyParser.json());
  
  router.post('/band/editProfile', function (req, res) {
    console.log(req.body);
    console.log("it hit !!!!!!!!!!!!!!!!!!");
    Band.findByIdAndUpdate(
      // the id of the item to find
  
     req.body.id,
      {
        bands: {
          bandName: req.body.bandName,
          genre: req.body.genre,
          numberOfMembers: req.body.numberOfMembers,
          city: req.body.city,
          state: req.body.state,
          zip: req.body.zip,
          travel: req.body.travel,
          travelDistance: req.body.travelDistance,
          spotify: req.body.spotify,
          youtube: req.body.youtube,
          soundcloud: req.body.soundcloud,
          twitter: req.body.twitter,
          facebook: req.body.facebook
        }
      },
      function (err, response) {
        // Handle any possible database errors
        if (err) {
          console.log("we hit an error" + err);
          res.json({
            message: 'Database Update Failure'
          });
        }
        console.log("This is the Response: " + response);
      }
    );
  });
  </code></pre>
  
  <p>here is my Band model:</p>
  
  <pre><code>//Module Imports
  const mongoose = require('mongoose');
  
  //Initializes a mongoose schema to be used with the document
  const bandSchema = new mongoose.Schema({
    bandName: String,
    genre: String,
    numberOfMembers: Number,
    city: String,
    state: String,
    zip: String,
    travel: Boolean,
    travelDistance: Number,
    spotify: String,
    youtube: String,
    soundcloud: String,
    twitter: String,
    facebook: String
  });
  
  //Creates the Schema to be used with the export
  let Band = mongoose.model('band', bandSchema);
  
  //Exports the Schema to the API
  module.exports = Band;
  </code></pre>
  
  <p>I've researched this pretty thoroughly and am stuck so any help is appreciated!</p>