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

Query with enum is not supported #59

Closed humhei closed 3 years ago

humhei commented 3 years ago
                let docs = db.GetCollection<RecordWithEnum>()
                docs.Insert { id = 1; color = ConsoleColor.Gray } |> ignore

                match docs.tryFindOne(fun doc -> doc.color = ConsoleColor.Gray ) with 
                | Some { id = 1; color = ConsoleColor.Gray } -> pass()
                | _ -> fail()

image

System.InvalidCastException: 'Value is not a valid BSON data type - Use Mapper.ToDocument for more complex types converts'