Commit 7a3967e2 authored by Caleb Weeks's avatar Caleb Weeks

adding limit option to the query specification

parent 55218de8
...@@ -185,11 +185,12 @@ module.exports = function restubFromBlQuery(params, cb){ ...@@ -185,11 +185,12 @@ module.exports = function restubFromBlQuery(params, cb){
var queryUrl; var queryUrl;
var orderBy = querySpecification.orderBy || ''; var orderBy = querySpecification.orderBy || '';
var limit = querySpecificatiion.limit || '-1';
if(sc.queryType === 'loki'){ if(sc.queryType === 'loki'){
queryUrl = `/bin/collections/query${queryPath}?filters=${queryString}&orderby=${orderBy}`; queryUrl = `/bin/collections/query${queryPath}?filters=${queryString}&orderby=${orderBy}`;
}else{ }else{
queryUrl = `/bin/collections/query?path=${queryPath}&filters=${queryString}&count=-1&orderby=${orderBy}`; queryUrl = `/bin/collections/query?path=${queryPath}&filters=${queryString}&count=${limit}&orderby=${orderBy}`;
} }
sc.getSling(queryUrl, {leaveMangledNames:true}, (err, validSourcePages)=>{ sc.getSling(queryUrl, {leaveMangledNames:true}, (err, validSourcePages)=>{
if(err){cb("Problem resolving map query: " + queryPath, err); return;} if(err){cb("Problem resolving map query: " + queryPath, err); return;}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment