Implement page function (#339)

* implement page function

Signed-off-by: wiseaidev <business@wiseai.dev>

* add unit tests

Signed-off-by: wiseaidev <business@wiseai.dev>

* fix linter issues

Signed-off-by: wiseaidev <business@wiseai.dev>
This commit is contained in:
Mahmoud Harmouch 2022-08-10 14:04:27 +03:00 committed by GitHub
parent ac6a75be19
commit e5e887229a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View file

@ -760,6 +760,9 @@ class FindQuery:
return await query.execute()
return await self.execute()
async def page(self, offset=0, limit=10):
return await self.copy(offset=offset, limit=limit).execute()
def sort_by(self, *fields: str):
if not fields:
return self