[CSHARP-2991] Regression of CSHARP-1521. ElemMatch requires IBsonArraySerializer for DictionaryInterfaceImplementerSerializer Created: 03/Mar/20 Updated: 27/Oct/23 Resolved: 12/Mar/20 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | BSON, Operations |
| Affects Version/s: | 2.10.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Damian Miłosz | Assignee: | Dmitry Lukyanov (Inactive) |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
The issue
Model is definied like this:
ClassMap is registered as below:
My query:
And I have a workaround that works for me, but I don't want to use it in long term:
Basically I can create new serializer, which inherits from DictionaryInterfaceImplementerSerializer, but also implements IBsonArraySerializer and then everything works.
|
| Comments |
| Comment by Damian Miłosz [ 13/Mar/20 ] | ||||||||||||||
|
It's working, thanks! I think it's worth fixing the section in the documentation: https://mongodb.github.io/mongo-csharp-driver/2.10/reference/bson/mapping/#dictionary-serialization-options to make it clear | ||||||||||||||
| Comment by Dmitry Lukyanov (Inactive) [ 12/Mar/20 ] | ||||||||||||||
|
Hello sekalek5@gmail.com,
This behavior is related to the fact that DictionaryInterfaceImplementerSerializer<TDictionary> is designed to work with not generic types, like Hashtable |