Zaid-Ajaj / LiteDB.FSharp

Advanced F# Support for LiteDB, an embedded NoSql database for .NET with type-safe query expression through F# quotations
MIT License
180 stars 22 forks source link

handle map with union Map<string, DU> #4

Closed AviAvni closed 6 years ago

AviAvni commented 6 years ago

when tring to serialize map that the value is Descriminated Union there is null reference exception

Zaid-Ajaj commented 6 years ago

Can you elaborate with more details?

AviAvni commented 6 years ago

Try to deserialize value of above type with multiple value in the map

type Value = Num of int | String of string
type Entity = { Id:string: Properties:map<string, Value> }

I get exception in Bson.rewriteKey But the serialization look ok

AviAvni commented 6 years ago

Great can you push the fix to nuget?

Zaid-Ajaj commented 6 years ago

Thanks for the details. The rewriteKey function will now ignore maps because these are not nested types.

I already pushed the fix to nuget, version 0.8.1 is now being indexed :smile:

AviAvni commented 6 years ago

Thank you very much great job it's help me a lot