Skip to content

A MongoDB database resource with cross-resource compatability.

Notifications You must be signed in to change notification settings

altv-crc/crc-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

[TS] MongoDB Cross Resource Database

Supported by CRC

This is a small resource that pulls in a library for database management that can be used in all resources.

It allows users to easily set and fetch data from any resource.

Usage

This resource handles the connection part, so skip that

See lib-cross-resource-cache for further usage.

Requires

Highly recommended to get the extension, for better event handling.

Installation

Inside of your main folder, you will need to install this library.

npm i @stuyk/cross-resource-cache
  • Create a folder in your src folder called crc-db.

  • Add the TypeScript files from this resource, to that folder.

You can also git clone directly into your src folder.

Setup

Modify server.toml and ensure it loads whatever you named the folder.

In the case of the example above it should be crc-db.

resources = [ 
    'mods-before-db',
    'crc-db',
    'resources-after-db',
    'dbg_reconnect'
]

Configuration

You need to modify the connectionString in the resource to point towards the right URL.

Open src/server/index.ts and modify the connectionString variable.

By default it uses localhost.

About

A MongoDB database resource with cross-resource compatability.

Topics

Resources

Stars

Watchers

Forks