0.0.11 • Published 10 years ago

nosqlited v0.0.11

Weekly downloads
37
License
-
Repository
github
Last release
10 years ago

NoSQLiteD Build Status Coverage Status

Yet another NoSQL implementation

This NoSQL database can be embeded, as a library to your project or started as a REST Service (daemon)

#LICENSE:

This module is licensed under the Apache License v2.0

Usage as a REST Server

npm install -g nosqlited

nosqlited --port=4200

Create MyDatabase

curl -X POST http://localhost:4200/nosqlite/api/v1/MyDatabase

Create MyBucket inside MyDatabase

curl -X POST http://localhost:4200/nosqlite/api/v1/MyDatabase/MyBucket

Create MyKey with a value of {"firstname":"Granny", "lastname":"Smith"}

curl -X PUT -H 'Content-Type: application/json' -d '{"firstname":"Granny", "lastname":"Smith"}' http://localhost:4200/nosqlite/api/v1/MyDatabase/MyKey

Getting back MyKey

curl http://localhost:4200/nosqlite/api/v1/MyDatabase/MyBucket/MyKey

Deleting MyKey

curl -X DELETE http://localhost:4200/nosqlite/api/v1/MyDatabase/MyBucket/MyKey

Deleting the whole Bucket with all the keys inside.

curl -X DELETE http://localhost:4200/nosqlite/api/v1/MyDatabase/MyBucket

Include this as a module in your own project

project.js

var NoSqlite = require('nosqlited');
var db = new NoSqlite("MyDatabase", {level:'debug', journal:false});

db.open().then(function () {
    return db.create('MyBucket');
}).then(function (bucket) {
    return bucket.set('MyKey', {firstname:'Granny', lastname:'Smith'});
}).then(function () {
    return db.bucket('MyBucket').get('MyKey');
}).then(function (document) {
    console.log('document=', document.value);
    return db.close();
}).then(function () {
    console.log('all is well, db closed');
}, function (reason) {
    console.log('ERROR: an error occured when playing with the db. reason=', reason);
}).done();
0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago