There is no server based database driver available with Godot Engine. If MongoDB developers are seeing this topic, will they consider the mongodb library for the Godot Engine?
Hi @Metehan_Ozbek, welcome!
<ItemGroup> <PackageReference Include="MongoDB.Driver" Version="2.10.2" /> </ItemGroup>
Or alternatively, you could also try to write a GDNative module either in C/C++. For example GDNative C++ , you should be able to write a module with
mongocxx driver, see also Tutorial: MongoDB C++ driver.
I’m using gdscript. I don’t have enough skills because I don’t know C ++
I have tried what you suggested using C# and the NuGet package. I can successfully access the NuGet package but don’t seem to be able to connect to the database as I get the following error exception when i try to insert a document using:
I can get the same code to work using .NET but fails when run through Godot. Godot is using Mono, is the driver compatible with Mono?
The error you listed seems to be related to DnsClient, check that you have connection to the MongoDB server from Godot.
In my test, I could connect from Godot to a locally hosted MongoDB using the following URI:
MongoDB .NET/C# driver is not being tested with Mono, although I’ve managed to create a simple test to query a document from MongoDB server using the current driver version 2.10.2. I’ve just added below lines to the
<ItemGroup> <PackageReference Include="MongoDB.Driver"> <Version>2.10.2</Version> </PackageReference> </ItemGroup>
Tested with Godot Engine 3.2.1 stable mono official, Mono v220.127.116.11 on macOS 10.14.6.