FileSystemStore
File System Store for persistence with MongoPortable, a portable MongoDB-like module.
Persists the collection and documents received by the MongoPortable module.
Installation
npm install --save file-system-store
NOTE: This module complements MongoPortable, a MongoDB-like portable database. If you don't have it installed, please read the documentation.
Usage
// Declaring the modules dependenciesvar MongoPortable = FileSystemStore = ; // Instantiates a new ddbb object by passing a ddbb namevar db = "TEST"; // Tells MongoPortable to use this store to persist the datadb; // Creates a new collection named "users" // (if it's already created, it will just return it instead)var users = db; // Inserts a new document into the collectionvar document = users;console; // -> { name: "John", lastName: "Abruzzi" } // Creates a cursor with the query information, ready to be fetchedvar cursor = users; // Iterates over the cursor, obtaining each document that matchs the querycursor;
Currently, we are supporting simple CRUD operations.
TO-DO List
Collection Operations
- Create
- Drop
Documents Operations
- Creating
- .insert()
- .save()
- Reading
- .find()
- .findOne()
- Updating
- .update()
- Deleting
- .remove()
Indexes Operations
- createIndex
- ensureIndex
- dropIndex
- reIndex
Backups Operations
- backup
- backups
- removeDackup
- restore
License
MIT