-
Notifications
You must be signed in to change notification settings - Fork 23
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
Sorted result in mongoose-aggregate-paginate-v2 is changing #18
Comments
@asmafakhfakh Can you share the query. Also try adding an index for creationDateTime field and try again. |
@aravindnc I tried indexing both fields i'm using for sort, doesn't resolve the problem.
|
Can you try sort inside aggregate itself. |
@aravindnc I added a sort stage and the problem persists
|
@asmafakhfakh If you don't mind, can you share your sample dateset with all required collections(minimal) to run the aggregate query, so I can test it at my end. |
Archive.zip |
has this problem been resolved ? |
I can also confirm that the order is changing even after adding indexes. Let me know how I can help. |
I fixed the problem by adding the @aravindnc I think now issue could be closed. |
@czystyl I dont think that solves it because the problem is not in documents that has equivalent dates for the sorted field that changes order, I get a totally wrong order, you can see that in the examples I put above. |
@aravindnc im having the same issue without sorting, i receive different responses. As you can se on the examples bellow, every array is a different request result, and they are all different:
This is the code of my method:
|
Hi, is there any solution to this or a workaround? Cuz I'm having the same problem. My aggregation with the $sort stage works just fine, but when I use aggregatePaginate I'm getting a different result. I've tried to add a sort to options, still no luck. |
Hello, is there a fix for this problem yet? |
I see this bug may not be fixed yet, so I assume it's too much to ask if it's possible to sort aggregation result's by full-text search textScore metadata? |
So I am on v1.0.42 and noticed a sort issue. what I found was the fields I am sorting on need to be in the result set ($project) or it won't sort the records properly |
I'm sending a query with postman to an apollo server to get a list of users.
This is my options object:
Sometimes when I resend the request with exactly the same parameters, the result changes even though my data is the same.
These are some samples of different results I got:
sample 1:
sample 2:
sample 3:
The text was updated successfully, but these errors were encountered: