Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Calculate total count

  • Loading branch information...
commit ad5ceff73ac85a00fa3c6e50bd7a17aa1e96d079 1 parent 65da339
@kriszyp kriszyp authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/resource-query.js
View
4 lib/resource-query.js
@@ -180,7 +180,9 @@ exports.executeQuery = function(query, options, target){
}
var results = eval(js + "target;");
if(options.start || options.end){
- return results.slice(options.start || 0, (options.end || Infinity));
+ var totalCount = results.length;
+ results = results.slice(options.start || 0, (options.end || Infinity));
+ results.totalCount = totalCount;
}
return results;
}
Please sign in to comment.
Something went wrong with that request. Please try again.