Skip to content

Instantly share code, notes, and snippets.

@sjcotto
Created June 26, 2014 01:21
Show Gist options
  • Save sjcotto/bb5d7cca92d59c7bb97e to your computer and use it in GitHub Desktop.
Save sjcotto/bb5d7cca92d59c7bb97e to your computer and use it in GitHub Desktop.
Kona DB Comunication
//SQL SERVICE
var test = function(){
//example insert
var script = {
service : "myService1",
query : "inser...",
update : true
}
kona.db.sql.execute(script);
//example select
var script = {
service : "myService1",
query : "select...",
update : false
}
var resultInJson = kona.db.sql.execute(script);
}
//REDIS Example
var test2 = function(){
var script = {
service : "myService1",
data : {
name : "Juan"
}
}
kona.db.redis.set(script);
var script = {
service : "myService1",
fields : [name,email]
}
var resultInJSon = kona.db.redis.get(script);
}
//MONGODB
var test2 = function(){
var script = {
service : "myService1",
data : {
name : "Juan"
}
}
kona.db.redis.set(script);
var script = {
service : "myService1",
fields : [name,email]
}
var resultInJSon = kona.db.redis.get(script);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment