docs: function (err, result) {
            // If we got here via a upsert() call, then options._returnObject will
            // be set and we should return the whole object. Otherwise, we should
            // just return the number of affected docs to match the mongo API.
            if (result && ! options._returnObject)
              callback(err, result.numberAffected);
            else
              callback(err, result);
          }