fastapi-pagination
fastapi-pagination copied to clipboard
Beanie ODM support
Hi, I think it would be helpful to add Beanie ODM support for pagination. I'll prepare Pull request in next few days.
Hi @TamiasSibiricus,
Do you have any plans to implement it?
Hi @uriyyo
Yes.. Just do not complete tests for plugin before my vacation. Will create PR next week.
Hey,
i just wanted to ask, if you still have plans to create a PR for this? I would like to use this module with my existing Fast-Api+Beanie API.
Hi @TamiasSibiricus,
Sorry for bothering you. Do you still have plans to implement this integration?
Hi @deejaypro,
Beanie integration has been added and will be released in the next version.
@uriyyo When can we expect next release? We are using right now with git url. 🙄
@syedhabib53 I hope I will do it in one week
fetch_links feature is missing in this implementation unfortunately!
If you have a query where you are searching through nested links you have the have fetch_links=True in the very latest find_many in paginate
It can be done like this
async def paginate(
query: Union[TDocument, FindMany[TDocument]],
params: Optional[AbstractParams] = None,
*,
additional_data: AdditionalData = None,
fetch_links: bool = False
) -> AbstractPage[TDocument]:
params, raw_params = verify_params(params, "limit-offset")
items = await query.find_many(limit=raw_params.limit, skip=raw_params.offset, fetch_links=fetch_links).to_list()
total = await query.find({}, fetch_links=fetch_links).count()
return create_page(items, total, params, **(additional_data or {}))
anyway there is a bug in beanie while the count won't work here roman-right/beanie#426
Hi @uriyyo , may I know when you will release the version with Beanie support please?
Hi all,
New version 0.11.0
has been released. Now fastapi-pagination
supports beanie
.