title: Mongoose Save Callback is not working
body: <p>I'm building a server for a simple web app that uses a MongoDB backend for storing data. I instantiate a new mongoose connection using:</p>
  
  <pre><code>mongoose.connect('mongodb://localhost:27017/callback-newsfeed-db')
  </code></pre>
  
  <p>My MongoDB output seems fine: </p>
  
  <pre><code>2017-12-02T21:00:53.277-0800 I NETWORK  [thread1] connection accepted from 127.0.0.1:52027 #86 (1 connection now open)
  2017-12-02T21:00:53.291-0800 I NETWORK  [thread1] connection accepted from 127.0.0.1:52028 #87 (2 connections now open)
  2017-12-02T21:00:53.291-0800 I NETWORK  [thread1] connection accepted from 127.0.0.1:52029 #88 (3 connections now open)
  2017-12-02T21:00:53.292-0800 I NETWORK  [thread1] connection accepted from 127.0.0.1:52030 #89 (4 connections now open)
  2017-12-02T21:00:53.292-0800 I NETWORK  [thread1] connection accepted from 127.0.0.1:52031 #90 (5 connections now open)
  </code></pre>
  
  <p>I also defined a Model as follows:</p>
  
  <pre><code>const postSchema = mongoose.Schema({
    api: String,
    source: String,
    title: String,
    upvotes: Number
  })
  
  const Post = mongoose.model('Post', postSchema)
  </code></pre>
  
  <p>In one of my server endpoints, I have the following code:</p>
  
  <pre><code>server.post('/posts', (request, response) =&gt; {
    console.log("INSIDE POSTS POST")
    const newapi = request.body.api
    const newsource = request.body.source
    const newtitle = request.body.title
  
    if(!newapi){
      response.send(422, "MUST PROVIDE API TYPE")
      return
    }else if(!newsource){
      response.send(422, "MUST PROVIDE RESOURCE SOURCE")
      return
    }else if(!newtitle){
      response.send(422, "MUST PROVIDE RESOURCE TITLE")
      return
   }
  
  // Add a new post
    const newPost = new post.Post({
        api: newapi,
        source: newsource,
        title: newtitle,
        upvotes: UPVOTE_DEFAULT
    })
    console.log("ABOUT TO SAVE")
  
    // Save to DB and send to client
    newPost.save(error =&gt; {
        console.log("SAVE ERROR " )
        console.log(error)
        if(error){
            console.log("ERROR IN NEWPOST")
            throw error
        }else{
            console.log("STATUS OK")
            response.status(STATUS_OK)
            response.set({'Content-type': 'application/json'})
            response.send(JSON.stringify(newPost))
        }
        console.log("SAVE HAS COMPLETED")
    })
    console.log("AFTER NEW POST")
    })
  </code></pre>
  
  <p>Now when I run my app, I see the following output in the console: </p>
  
  <pre><code>INSIDE POSTS POST
  ABOUT TO SAVE
  AFTER NEW POST
  </code></pre>
  
  <p>However, for some reason (regardless of how long I wait) no part of the newPost.save() callback ever seems to get called.  The MongoDB output doesn't indicate an obvious error, so I'm a bit lost. Why could that be happening?</p>
  
  <p>I'm pretty new to node so any thoughts on how to even go about debugging this or thinking about possible bug culprits would be greatly appreciated!</p>