I was trying to implement MongoDB in my Unity WebGL game and everything is working fine in the editor: I managed to insert and retrieve documents from my Mongo database with no issues.
Everything seemed perfect until I compiled the project and realized that my WebGL build won't communicate with my database at all!
I took a look at the console and I see this error:
MissingMethodException: Default constructor not found for type MongoDB.Bson.Serialization.BsonClassMap`1[[UserAccount, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]
I have no clue what's happening. I tried compiling the project for Windows/Linux and I got the same error, then I changed API compatibility level to 4.x and it was working fine on the Windows build, but not on WebGL ( API compatibility level=4.x is checked for WebGL build!)
Can someone lend me a hand with that?