Socket
Socket
Sign inDemoInstall

file-system-store

Package Overview
Dependencies
5
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    file-system-store

File System Store for MongoPortable, a portable MongoDB module (https://github.com/eastolfi/MongoPortable)


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Install size
14.2 MB
Created
Weekly downloads
 

Readme

Source

FileSystemStore

File System Store for persistence with MongoPortable, a portable MongoDB-like module.

Package Version NodeJS Version

Linux Build Windows Build Test Coverage Downloads Documentation Status

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 dependencies
var MongoPortable = require("mongo-portable"),
    FileSystemStore = require("file-system-store");

// Instantiates a new ddbb object by passing a ddbb name
var db = new MongoPortable("TEST");

// Tells MongoPortable to use this store to persist the data
db.addStore(new FileSystemStore({
    // The path where the database will be stored
    ddbb_path: "MY_PHISICAL_DDBB_PATH",
    // Whether the persistance will be asynchronous or not
    sync: true
}));

// Creates a new collection named "users" 
//      (if it's already created, it will just return it instead)
var users = db.collection("users");

// Inserts a new document into the collection
var document = users.insert({ name: "John", lastName: "Abruzzi" });
console.log(document);  // -> { name: "John", lastName: "Abruzzi" }

// Creates a cursor with the query information, ready to be fetched
var cursor = users.find({ name: "John" });

// Iterates over the cursor, obtaining each document that matchs the query
cursor.forEach(function(doc) {
    console.log(doc);  // -> { name: "John", lastName: "Abruzzi" }
});

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

Keywords

FAQs

Last updated on 25 Jan 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc