I am starting a project were I am developing a web-OS App and I am trying to connect my app to a database, here is some code I found but I don't understand it, does anyone has a guide or videos on how to do this?
I don't understand where do I put the db name and credentials and how do I call the returning objects?
Example
var request = webOS.service.request("luna://com.palm.db", {
method: "get",
parameters: {
"ids" : ["J8rKTaBClIo"]
},
onSuccess: function (inResponse) {
console.log( inResponse.results.length() + " object(s) is(are) retrieved");
console.log( "Result: " + JSON.stringify(inResponse) );
// To-Do something
},
onFailure: function (inError) {
console.log("Failed to get the obejct(s)");
console.log("[" + inError.errorCode + "]: " + inError.errorText);
// To-Do something
return;
}
});
Return Value
{
"returnValue": true,
"results": [
{
"_rev": 21,
"sample": "sample1",
"test": "test1",
"_id": "J8rKTaBClIo",
"_kind": "com.yourdomain.test:1"
}
]
}
I want to grab this info and show it into a lable.