1.0.6 • Published 2 years ago

paginator-v1 v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
2 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

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago