-
Notifications
You must be signed in to change notification settings - Fork 15
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
pymongo.sort supports non-iterable input of a single key #52
Comments
Artucuno
added a commit
to Artucuno/pydantic-mongo
that referenced
this issue
Dec 6, 2023
I think the design of this is intentional, because the |
Not sure if that is a valid case, because |
Artucuno
added a commit
to Artucuno/pydantic-mongo
that referenced
this issue
Dec 7, 2023
#45 now supports these as sorting inputs Union[str, Sequence[Tuple[str, int]], Tuple[str, int]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pymongo supports
.sort("field", 1)
pydantic-mongo's
__map_sort
only supports an iterable of tuples, for multiple fields:.sort([("field1", 1), ("field2", -1)])
And there should be an example on this on the main page :) I had to dig this out of the tests.
The text was updated successfully, but these errors were encountered: