title: Sails.js controller not inserting into Mongo database
body: <p>I've been all over SO and Sailsjs.org trying to figure out what's going wrong, and to no avail. Just trying to learn the basics of SailsJS. I have a UserController, whose <code>create()</code> method gets called when a <code>POST</code> request is sent to <code>/user</code>.  </p>
  
  <pre><code>create: function (req, res) {
      var params = req.params.all();
  
      User.create({
          name: params.FirstName + ' ' + params.LastName,
          email: params.Email,
          password: params.Password,
          jobTitle: params.JobTitle
      }).exec(function createCB(err,created)
      {
          created.save(function(err)
          {
              // No error . . . still nothing in db
          });
          return res.json({name: created.name, jobTitle: created.jobTitle, email: created.email, password: created.password});
      });
  }
  </code></pre>
  
  <p>No errors here. All the request params are coming in fine and going back to the client without trouble. But nothing is actually being written to the database. </p>
  
  <p>In development.js:</p>
  
  <pre><code>connections: {
      mongo: {
          adapter: 'sails-mongo',
          host: 'localhost',
          port: 27017,
          // user: 'username',
          // password: 'password',
          database: 'sails_test'
      }
  },
  
  models: {
      connection: 'mongo'
  }
  </code></pre>
  
  <p>I've tried this with the above both there in development.js, as well as separately in connections.js and models.js, respectively. No difference.</p>
  
  <p>In User.js:</p>
  
  <pre><code>attributes: {
  
      FirstName : { type: 'string' },
  
      LastName : { type: 'string' },
  
      Email : { type: 'string' },
  
      Password : { type: 'string' },
  
      JobTitle : { type: 'string' }
  }
  </code></pre>
  
  <p>My front end request:</p>
  
  <pre><code>$.ajax({
          method: 'post',
          url: '/user',
          data: {
              FirstName: 'Yo', 
              LastName: 'Momma',
              Email: 'yourmom@yourdadshouse.com',
              Password: 'YouWish123',
              JobTitle: 'Home Maker Extraordinaire'
          },
          success: function (sailsResponse) 
          {
              $('#result').html(sailsResponse).fadeIn();
          },
          error: function()
          {
              console.log('error');
          }
      });
  </code></pre>
  
  <p>Again, none of this is producing an explicit error. There is just nothing being inserted into the database. Or if there is, I don't know how to find it. I've confirmed the existence of this db in the mongo shell, thusly:</p>
  
  <pre><code>show dbs
  </code></pre>
  
  <p>My db, <code>sails_test</code> shows up in the list. And I've confirmed that there isn't anything in it like so:</p>
  
  <pre><code>db.sails_test.find()
  </code></pre>
  
  <p>I would very much appreciate some guidance here :)</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Turns out the data is being written just fine. I'm just unable to query the database from the command line. I confirmed this by first creating a sample user, and then using Waterline's <code>findOne()</code> method:</p>
  
  <pre><code>User.findOne({FirstName: params.FirstName}).exec(function (err, user) {
      if (err) {
          res.send(400);
      } else if (user) {
          return res.json({firstName: user.FirstName, lastName: user.LastName, jobTitle: user.JobTitle, email: user.Email, password: user.Password});
      } else {
          return res.send('no users match those criteria');
      }
  });
  </code></pre>
  
  <p>The above works as expected. So my problem now is simply that I cannot interact with the database from the command line. <code>db.&lt;collectionName&gt;.find({})</code> produces nothing. </p>