1.0.6 • Published 3 years ago

paginator-v1 v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Usage

import { Paginator, PaginatedResponse } from "paginator-v1";

// Initialize a new Paginator
const page = 1;

const query = YourMongoModel.find({});
const Paginator = new Paginator(query);

let paginated_response: PaginatedResponse = await Paginator.getPaginatedResponse(page);
// Returns
{
    result: [
        object,
        ...
    ];
    hasNextPage: false;
    hasPreviousPage: false;    
}
1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago