feat: Adding states endpoint and regex find to current endpoints
This commit is contained in:
@@ -25,10 +25,10 @@ function getPagination( query ){
|
||||
return limit;
|
||||
}
|
||||
|
||||
async function queryPage( page , elements , model ){
|
||||
async function queryPage( page, elements, model, filter=null, projection=null){
|
||||
const skip = elements * page;
|
||||
const total = await model.count();
|
||||
const list = await model.find( null , null, { skip : skip , limit : elements } );
|
||||
const list = await model.find( filter, projection, { skip : skip , limit : elements } );
|
||||
return {
|
||||
total : total,
|
||||
limit : elements,
|
||||
|
||||
Reference in New Issue
Block a user