xiron9090 / modular_database

A modular database for add database service for any project

Repository from Github https://github.comxiron9090/modular_databaseRepository from Github https://github.comxiron9090/modular_database

Modular Database

A modular database for add database service for any project

  • Import the module and instantiate an object with the database choised
const database = require('./modular_database')
in MongoDB case
const mongo = new database.mongo_db({ MONGO_URI: 'mongodb://<admin>:<user>@<host>:<port>/<database>' })

Methods

All modules methods, are async functions, the params query are javascript objects with the filters of query for mongo db. Read de docs https://mongoosejs.com/docs/queries.html

async mongo.create(query,Schema)
async mongo.get(query,Schema,{sort,limit})
async mongo.update({query,options,array},Schema)
async mongo.delete(query,Schema)

Until now, the module only manage MongoDB database's, but in the future works with MySQL, Postgresql and Firebase Firestore.

MongoDB PostgreSQL MySQL Firebase
MongoDB PostgreSQL MySQL Firebase
+Supported -Not Suported -Not Suported -Not Suported

About

A modular database for add database service for any project

License:Apache License 2.0


Languages

Language:JavaScript 100.0%