Skip to content

3ddelano/mongo-driver-godot

Repository files navigation

Mongo Driver for Godot

(Get it from Godot Asset Library - Coming Soon)

logo

Unofficial MongoDB driver for Godot Engine 3.3.

Should support Windows, Linux, OSX (Currently only built on Windows)


Godot3

Features

  • CRUD operations on Database/Collection
  • Document validation
  • Pipeline / Aggregation operations
  • Run commands on Database
  • Operations on Collection Indexes

Installation

This is a regular plugin for Godot. Copy the contents of addons/mongo-driver-godot into the addons/ folder in the same directory as your project (There is NO need to activate the plugin in ProjectSettings).

For in-depth installation instructions check the Installation Wiki

For Linux / OSX see Building the plugin

Getting Started

  1. You may have to restart the Godot Editor to register the GDNative classes.
  2. A basic example is given below:
extends Node

func _ready():
    var driver: MongoDriver = MongoDriver.new()
    var connection: MongoConnection = driver.connect_to_server("mongodb://localhost:27017")

    # Check for an error
    if Mongo.is_error(connection):
        print("Got error: ", connection)
        return

    # Print the names of the all the databases
    print(connection.get_database_names())

Benchmarks

Tested on Windows 10 21H2 x64 (Godot 3.4.2) To test locally run the scripts in tests/benchmark folder using the tester addon.

See example script in scripts/run_tests.bat Click for in-depth testing instructions

Operation Number of Documents Time (s)
Insert one 10 0.49
Insert one 10,000 4.68
Insert many 10 0.68
Insert many 10,000 0.90

Thirdparty Libraries

See Thirdparty Libraries

Contributing

This plugin is a non-profit project developped by voluntary contributors.

Supporters

None, you can be the first one!

Support the project development

Buy Me A Coffee

Want to support in other ways? Contact me on Discord: @3ddelano#6033

For help / suggestions join: 3ddelano Cafe

Disclaimer: This project is not affiliated nor endorsed by MongoDB Inc. nor Godot Engine