Simple C# code. Able to use it in GDScript with Godot4(C# Support).
<Project Sdk="Godot.NET.Sdk/4.1.2">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.22.0"/>
</ItemGroup>
</Project>