MongoPortable
Solution for a MongoDB-like portable database.
MongoPortable is a module that handles collections and documents in memory, and allow the use of stores for persistence.
This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to eduardo.astolfi91.com.
Installation
npm install mongo-portableyarn add mongo-portable
Usage
// Declaring the module dependency; // Instantiates a new ddbb object by passing a ddbb namelet db = "DB_NAME"; // Creates a new collection named "users" // (if it's already created, it will just return it instead)db;
Modules
The main modules available are MongoPortable and Collection (and Cursor when using the "doNotFetch" option).
MongoPortable
Handles the database, collections and connections.
Read the full API documentation here
Collection
Handles the list of documents by using cursors.
Read the full API documentation here
Cursor
Fetchs and access the documents to return them to the client.
Read the full API documentation here
Stores
File System Store
It is located in a separated module, so install it by:
npm install file-system-storeyarn add file-system-store
And then use it in your application by adding it in your MongoPortable instance:
; db;
or as a middleware:
; db;
View the package here and read the full API documentation here
Contributing
Feel free to contribute with your own ideas / fixes!
There is a to-do list with the features I'd like to add in the feature, and a serie of milestones with the roadmap I have in mind. Take a look at them if you want to :)
Every contribution should be addressed with a well-formed pull request -> Contributing