[Release] MongoDB wrapper resource

FiveM MongoDB wrapper

Description

This resource is a simple MongoDB wrapper for FiveM. It’s running on top of MongoDB Node Driver.

This is my first public resource, so any feedback will be appreciated :slightly_smiling_face:

Installation

  1. Clone this repository to resources/mongodb folder.
  2. Copy mongodb/database.cfg to your server root directory.
  3. Add the following lines to your server config:
exec "database.cfg"
start mongodb
  1. Change mongodb_url and mongodb_database in database.cfg.
  2. Run npm install in resources/mongodb directory.

Usage

See README and example.lua script.

Download

Credits

10 Likes

Good idea to make this in JS so that it’s compatible with Windows too!

Great release :+1:

1 Like

How to make a synchronous query ?

The queries are already synchronous

really interesting, this one maybe better than mysql.
so when i try to migrate mysql to mongodb
and i already put it all like your tutorial but this is gave me error.
testing
can you teach me how to do it?!

1 Like

Great resource and will 100% use it, just would love to see examples of inserting data into an existing user schema instead of just inserting one into the collection

can you show me exports.mongodb.deleteOne cause i got error invalid params object

my code
exports.mongodb.deleteOne({ collection=“table”, query = { id = parameter }})

Hey, can anyone help me out to get rid with this error I tried everything like setconvar function and tried to set canvar using console execution.
FireShot Capture 005 - (0) txAdmin - localhost