Giter VIP home page Giter VIP logo

mongo-driver-godot's Introduction

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

mongo-driver-godot's People

Contributors

3ddelano avatar abdera7mane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mongo-driver-godot's Issues

Usage with Godot Mono (C#)

Although this plugin doesn't natively support C# we can still use this plugin in Godot projects if you really want to.
The best approach would be to use the Official C# mongodb package

using Godot;
using System;

public class Main : Control
{
    public override void _Ready()
    {
        GDScript MongoDriver = (GDScript) GD.Load("res://addons/mongo-driver-godot/wrapper/mongo_driver.gd");
        // Need to manually type-cast to Godot.Object each time
        Godot.Object driver = (Godot.Object) MongoDriver.New();
        Godot.Object conn = (Godot.Object) driver.Call("connect_to_server", "mongodb://localhost:27017");
        Godot.Object db = (Godot.Object) conn.Call("get_database", "test");
        Godot.Object col = (Godot.Object) db.Call("get_collection", "products");
        GD.Print(col.Call("find"));
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.