index.js
function (ctx, next) {
    var filter;
    if (ctx.args && ctx.args.filter) {
      filter = ctx.args.filter.where;
    }

    if (!ctx.res._headerSent) {
      this.count(filter, function (err, count) {
        ctx.res.set('X-Total-Count', count);
        next();
      });
    } else {
      next();
    }
  }
function (ctx, next) {
    var filter;
    if (ctx.args && ctx.args.filter) {
      filter = ctx.args.filter.where;
    }

    if (!ctx.res._headerSent) {
      this.count(filter, function (err, count) {
        ctx.res.set('X-Total-Count', count);
        next();
      });
    } else {
      next();
    }
  }
function ( ctx , next ) { var filter ; if ( ctx . args && ctx . args . filter ) { filter = ctx . args . filter . where ; } if ( ! ctx . res . _headerSent ) { this . count ( filter , function ( err , count ) { ctx . res . set ( 'X-Total-Count' , count ) ; next ( ) ; } ) ; } else { next ( ) ; } }
Set X-Total-Count for all search requests
Set X - Total - Count for all search requests