uriyyo / fastapi-pagination

FastAPI pagination 📖
https://uriyyo-fastapi-pagination.netlify.app/
MIT License
1.1k stars 126 forks source link

is there anyway to limit the total value? #1134

Open jochman opened 2 months ago

jochman commented 2 months ago

Hi again! I'm using motor.

Is there any way to limit the Total value?

I couldn't find a way that isn't included in give a first $limit to aggregate then keep the paginate_aggregate as usual.

uriyyo commented 2 months ago

Hi @jochman,

I'm not sure I understood what you want to achieve(

You want to limit total number of returned rows by paginate_aggregate function?

onejgordon commented 2 months ago

I'm not sure if this is what the original question is about, but I interpreted it as a way to ceiling the number of records counted in the total response, presumably for performance reasons. Is this supported?

uriyyo commented 2 months ago

@onejgordon I'm not sure about that. Sorry, need to take a look. I guess this integration was done by one of contributors, I need to figure out what is going on inside implementation.