Coder Social home page Coder Social logo

gmsv_mongolink's Introduction

gmsv_mongolink

Garry's Mod 13 binary module for interfacing with MongoDB databases.

  • Provides basic MongoDB interface functionality within Garry's Mod.
  • Windows Only (at this point! haven't gotten around to building on Linux yet)
  • Early development phase - not particularly suggested for production use.

Why? We have tMySQL and MySQLOO for database options!

MongoDB is being used in newer web-based application installations, and is becoming very popular among programmers in the realm of modern environments such as NodeJS. Why not bring this functionality to Garry's Mod? MySQL is tested and proven, but lacks in ease of use compared to MongoDB (imho).

(This is my first big C++ project, so don't harm me if you find something disgusting)

You can use the binaries located in the builds folder, or build your own with the following instructions. The included binaries should be up to date with the source code unless stated otherwise.

Building your own binaries

  • Install prerequisites

  • Boost - Requires 1.55.0 (32-bit VS2010 binaries) obtainable from here. The premake configuration searches for boost library files at C:/local/boost_1_55_0 (the default install directory)

  • Bootil - Included in repository. Could compile on your own if you'd like to. By Garry Newman.

  • MongoClient - Included in repository. 26compat branch built and included for convenience.

  • Run BuildProjects.bat to generate a Visual Studio 2010 project file with build configuration automatically setup.

  • Premake can also be configured to generate projects for different versions of Visual Studio. Be aware you may need different Boost libraries for a Visual Studio install other than 2010... I think

  • Open the Visual Studio file located in /projects/windows/ and build the project.

  • Outputs to /builds/windows/gmsv_mongolink_win32.dll on success!

Basic Usage

You can check out the source code, of course, to see how the module works. But here's a simple example:

Make sure you have a copy of mongoclient.dll sitting next to your srcds.exe!!! (You can find the mongoclient.dll in the /lib folder of this repository)

require("mongolink");

local db = mongo.New()

db:Connect("kahana.mongohq.com:10034")
db:Auth("gmod", "gmodtest", "gmodtestpass")

PrintTable(db:ListCollections())

db:Insert("testInsert", {test = true, day = 5})

PrintTable(db:Query("testInsert", {day = 5}))

Contribution guidelines

  • Please help out if you can! This module has potential to be very useful.

Author

gmsv_mongolink's People

Contributors

spencersharkey avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gmsv_mongolink's Issues

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.