dbpouch
v0.1.8
Published
Fastest and easiest database in cloud, based on PouchDb & node-pouch. Work with multiple cloud databases like a PRO.
Downloads
14
Maintainers
Readme
dbpouch
Fastest and easiest database in cloud, hosted on CDN. Work with multiple cloud databases like a PRO.
To generate access code and get API key, please read instructions on the website: https://dbpouch.com/
Usage:
var dbpouch = require("dbpouch");
var db = new dbpouch({
database: "<test>",
cdn: {
email: "<email>",
apiKey: "<apiKey>",
domain: "<domain/space>",
folder: "<folder>"
}
});
db.save({name: "Apple", type: "fruit"}).then(function(data) {
console.log(data);
}).catch(function(error) {
console.log(error);
});
Methods:
.save(data, database);
data
: Should be an object. Record ID should be specified as_id
.
Example:.save({_id: "apple", name: "Apple", type: "fruit"});
.database
: Optional if already provided when creating a new instance of the module. Useful if you want to use a different database name.
.delete(id, database);
id
: Delete a record using itsid
. Example:.delete("apple");
.database
: Optional if already provided when creating a new instance of the module. Useful if you want to use a different database name.
.get(id, database);
id
: Fetch a record using itsid
. Example:.get("apple");
.database
: Optional if already provided when creating a new instance of the module. Useful if you want to use a different database name.
.record(query, database);
query
: Search and get the record. Examples:.record({_id: "apple"});
,.record({name: "Apple"});
,.record({name: "Apple", type: "fruit"});
. Gets only single record if multiple records match the query.database
: Optional if already provided when creating a new instance of the module. Useful if you want to use a different database name.
.records(query, database);
query
: Search and get the records. Examples:.records({_id: "apple"});
,.records({name: "Apple"});
,.records({type: "fruit"});
.database
: Optional if already provided when creating a new instance of the module. Useful if you want to use a different database name.
See https://dbpouch.com/ for more information.
Copyright © DbPouch