title: How to confirm if update succeeds using mongoose and bluebird promise
body: <p>I'm using <code>bluebird</code> and <code>mongoose</code> for a node page.
  I want to check if the update is successful before sending data back to clients via <code>socket.js</code>.Here's the part of the code that I can't figure out:</p>
  
  <pre><code>.then(function(a) {
      var g = collection3.update({
          _id: a.one[0]._id
      }, {
          $set: {
              avg: a.one[0].avg
          }
      }).function(err, d) {
          if (!err) {
              return 1; // Here's the problem
          }
      }) return {
      updated: g,
      info: a
  };
  }).then(function(c) {
      console.log(c.updated); // I can't get the `1` value
      if (c == 1) {
          io.sockets.in('index|1').emit("estimate", c.three);
      }
  })
  </code></pre>
  
  <p>Does mongoose return a success message after update? I can't return <code>1</code> from the update query and pass it to the next then function, instead, I'm getting this object:</p>
  
  <pre><code>{ _mongooseOptions: {},
    mongooseCollection:
     { collection:
        { db: [Object],
          collectionName: 'table',
          internalHint: null,
          opts: {},
          slaveOk: false,
          serializeFunctions: false,
          raw: false,
          pkFactory: [Object],
          serverCapabilities: undefined },
       opts: { bufferCommands: true, capped: false },
       name: 'table',
       conn:....
  </code></pre>
  
  <p>Here's the full code:</p>
  
  <pre><code>  socket.on("input",function(d){ 
      Promise.props({
         one: collection2.aggregate([
          {
           $match:{post_id:mongoose.Types.ObjectId(d.id)}
          },
          {
           $group:{
                   _id:"$post_id",
                   avg:{$avg:"$rating"}
                  }
          }
         ]).exec();
     }).then(function(a){     
        var g = collection3.update({_id:a.one[0]._id},{$set:{avg:a.one[0].avg}}).function(err,d){
          if(!err){
            return 1; // Here's the problem
          }
        })
        return {updated:g,info:a};
     }).then(function(c){
        console.log(c.updated); // I can't get the `1` value
        if(c.updated == 1){
          io.sockets.in('index|1').emit("estimate",c.three);
        }
     }).catch(function (error) {
       console.log(error);
     })
  </code></pre>