Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I retrieve matched results count with results when using aggregation sets? #360

Open
imansafari1991 opened this issue Apr 21, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@imansafari1991
Copy link
Contributor

Hi there
I want to retrieve the matched results count with results simultaneously to reduce roundtrips when I use pagination in my aggregation query. Is it possible to act in Redis.OM?
If I want to say clearly I want the pointed result in the following picture:
image

@slorello89
Copy link
Member

I think you can probably run both a count and your aggregation together asynchronously. Ironically I think the low level results set (which isn't exposed) does capture the count 🤔

@imansafari1991
Copy link
Contributor Author

Yes @slorello89
I ran both as you said, but sometimes our queries (primarily aggregate) are time-consuming, I think about something like PaginatedResult that can expose this count when we have pagination to reduce round trips and prevent calling complex queries two times.

@slorello89 slorello89 added the enhancement New feature or request label May 2, 2023
@slorello89
Copy link
Member

right @imansafari1991 - but if you just run the count reduction in parallel wouldn't that just reply with the count for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants