zakodium / adonis-mongodb

MongoDB provider for AdonisJS 5
https://zakodium.github.io/adonis-mongodb/
Other
64 stars 12 forks source link

Pagination features missing #108

Closed maasencioh closed 3 years ago

maasencioh commented 3 years ago

Normally during pagination is necessary to sort, skip and limit a query. A proposed API could be

const cursor= Model.query({}).sort('field', 1);
const total = await cursor.count();
const items = await cursor.skip(10).limit(10).all();
targos commented 3 years ago

@maasencioh proposed implementation at https://github.com/zakodium/adonis-mongodb/pull/112