Example #1
0
      function () {
        if (count > 0) return this.emit('end');

        var status = controller.emptyCollection();
        response.status(status);

        if (status === 204) return this.emit('end');
        if (status === 200) {
          response.json([]); // TODO other content types
          this.emit('end');
          return;
        }

        this.emit('error', RestError.NotFound());
      }
Example #2
0
 function () {
   if (count > 0) return this.emit('end');
   this.emit('error', RestError.NotFound());
 }
Example #3
0
 query.exec(function (error, doc) {
   if (error) return callback(error);
   if (!doc) return callback(RestError.NotFound());
   // Add the Mongoose document to the context.
   callback(null, { doc: doc, incoming: context.incoming });
 });