Getting Started
Getting Started
Learn how to install and set up gmsv_mongo for your Garry's Mod server
Getting Started
Welcome to gmsv_mongo! This guide will help you get started with the MongoDB driver for Garry's Mod.
What is gmsv_mongo?
gmsv_mongo is a high-performance MongoDB driver for Garry's Mod, built with Rust for maximum performance and reliability. It provides:
- Full CRUD Operations: Create, Read, Update, Delete with sync and async variants
- Aggregation Pipelines: Powerful data analysis and transformation
- Index Management: Optimize your queries with custom indexes
- Connection Pooling: Efficient connection management for high-traffic servers
- Async Support: Non-blocking operations with callback-based API
Quick Start
-- Load the module
require("mongo")
-- Create a connection
local client = MongoDB.Client("mongodb://localhost:27017")
-- Get database and collection
local db = client:Database("gameserver")
local players = db:Collection("players")
-- Insert a document
local id = players:InsertOne({
steamid = "STEAM_0:1:12345",
username = "Player1",
level = 1
})
print("Inserted player with ID:", id)