Skip to content

Instantly share code, notes, and snippets.

@EarthenLynx
EarthenLynx / monconnect.js
Last active January 20, 2020 19:00
Javascript module. Exports a class to make communication with mongodb easier
const mc = require('mongodb').MongoClient;
class MonCon {
// Takes all the neede vars to connect to a database
constructor(host_ip, host_port, db_url, db_name, db_collection) {
this.host_ip = host_ip;
this.host_port = host_port;
this.db_url = db_url;
this.db_name = db_name;
this.db_collection = db_collection;