Summary
Since changing the version of the LINQ driver to v3 we receive this error, in v2 everything was working fine. The main problem seems to be that the key of the dictionary is a enum (which is mapped to a string with a RegisterClassMap).
How to Reproduce
Query:
Collection.AsQueryable<Translation>.Where(x => x.Languages.ContainsKey(language)).ToListAsync(token);
Mapping:
BsonClassMap.RegisterClassMap<Translation>(doc => { doc.AutoMap(); doc.SetIgnoreExtraElements(true); doc.MapIdMember(a => a.Id) .SetIdGenerator(new StringObjectIdGenerator()) .SetSerializer(new StringSerializer(BsonType.ObjectId)); doc.MapMember(a => a.Languages) .SetSerializer(new DictionaryInterfaceImplementerSerializer<Dictionary<Languages, string>>( DictionaryRepresentation.Document, new EnumSerializer<Languages>(BsonType.String), new StringSerializer() )); });