Skip to content

Storage adapter `nstore` for `node-document` ODM for Node.js.

License

Notifications You must be signed in to change notification settings

grimen/node-document-storage-nstore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NODE-DOCUMENT-STORAGE-NSTORE Build Status

Storage adapter nstore for node-document ODM for Node.js.

Installation

  $ npm install node-document-storage-nstore

Usage

Basic:

  var Storage = require('node-document-storage-nstore');

  var storage = new Storage(); // Connect using defaults (i.e. `localhost`)

  var data = {
    keys: ['post/1', 'post/abc'],
    values: [{title: "foo", tags: ['foo', 'bar'], published: true}, {title: "bar", tags: ['baz'], published: false}]
  };

  var inspect = require('util').inspect;

  console.log('STORAGE: `%s`', storage.name);
  console.log('\nURL: `%s`', storage.url);

  storage.set(data.keys, data.values, function(errors, results) {
    console.log("\nSET  %s  ->  %s", inspect(data), inspect(results));

    storage.get(['post/1', 'post/abc'], function(errors, results) {
      console.log("\nGET  %s  ->  %s", data.keys, inspect(results));

      storage.del(['post/1', 'post/abc'], function(errors, results) {
        console.log("\nDEL  %s  ->  %s", data.keys, inspect(results));

        storage.get(['post/1', 'post/abc'], function(errors, results) {
          console.log("\nGET  %s  ->  %s", data.keys, inspect(results));
        });
      });
    });
  });

For details; see node-document.

Test

Local tests:

  $ make test

License

Released under the MIT license.

Copyright (c) Jonas Grimfelt

Bitdeli Badge

About

Storage adapter `nstore` for `node-document` ODM for Node.js.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published