-
Notifications
You must be signed in to change notification settings - Fork 0
DataBase Service
Gihan Karunarathne edited this page Jun 17, 2014
·
1 revision
Document Storage Service.
var swisher_client = require('swisher-client'),
dbService = swisher_client.DataBase("7780aa6c75f9439ed416e0501294a3831abe1a05", "8", {
grantType : "access_token",
scope : "test"
});Parameters:
Document to be created/added. Should be a valid JSON object.
dbService.create({"name":"John","age":"30"}, function(err){
if (err) {
// Handle Error Here
} else {
// -- Code Here
}
});Parameters:
JSON query to find the document in the storage.
dbService.read({"name":"John"}, function(err, result){
if (err) {
// Handle Error Here
} else {
// -- Code Here
}
});Parameters:
JSON query to find the document in the storage.
dbService.reads({"name":"John"}, {}, function(err, result){
if (err) {
// Handle Error Here
} else {
// -- Code Here
}
});Parameters:
JSON query to find the document in the storage.
Document to be created/added. Should be a valid JSON object.
dbService.update({"name":"John"}, {"age":"45"}, function(err){
if (err) {
// Handle Error Here
} else {
// -- Code Here
}
});Parameters:
JSON query to find the document in the storage.
dbService.delete({"name":"John"}, function(err){
if (err) {
// Handle Error Here
} else {
// -- Code Here
}
});