You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
** (MatchError) no match of right hand side value: {:error, %Mongo.Error{code: 14, error_labels: [], fail_command: false, host: nil, message: "Expected field sortto be of type object", not_writable_primary_or_recovering: false, resumable: false, retryable_reads: false, retryable_writes: false}}
I've tracked the code down to this function where it reduces over the list. When it's a list of key/value tuples, it will create an iodata encoded bson object, but if it's empty, the io data will be "". I'm not sure what the right answer is here. With elixir, you can't determine whether [] is meant to be an empty list or empty keyword list.
The text was updated successfully, but these errors were encountered:
The :sort keyword belongs to the option of the find function. First, you can just avoid specifying an empty list for the sort option. But we can extend the filter_nils function to handle this case (sort: []) as well.
One is able to sort with a keyword list, but if you sort with an empty keyword list (aka empty list), it gives an error.
Reproduction steps:
This will create a match error:
I've tracked the code down to this function where it reduces over the list. When it's a list of key/value tuples, it will create an iodata encoded bson object, but if it's empty, the io data will be
""
. I'm not sure what the right answer is here. With elixir, you can't determine whether[]
is meant to be an empty list or empty keyword list.The text was updated successfully, but these errors were encountered: