3.1.2 • Published 4 years ago

mongo_dal v3.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

MONGO_DAL

Mongo DAL is a data access layer provided for the Code 3 code base. It's design was to provide a unified and easy means of interacting with a Mongo database in a asynchronous fashion. The exposed IMongoDAL interface aims to unify any database interactions by giving standardized methods that any implementing concrete DAL should provide. Additionally provided in the Mongo DAL are two concrete classes for creating a in-memory and remote database, with most of the heavy-lifting of these classes done by the native Node.js MongoDB driver.

Now includes an In Memory Database with all the functionality of the Mongo DAL!

Files

  • IMongoDAL.ts - An interface that exposes common methods for interacting with a Mongo database.
  • MongoDAL.ts - Some syntactic sugar around the MongoDB native methods, wrapped up in a convenient class.
  • MemoryMongoDAL.ts - A mirror of the MongoDAL.ts class, but creates an in-memory database. Of course, also wrapped up in a convenient class

Installation

This code is better interacted with as its NPM Package counterpart, but if you want to add some common concrete classes to it, or recompile you can:

BUILD :hammer:
npm install
Test :mag_right:
npm test
Test In Memory Database :muscle:
npm imdbtest