I have the table “Products” with full fields. I try to find and get values with some condition. This is javascript file
var APPLICATION_ID = "id",
SECRET_KEY = "key",
VERSION = "v1";
Backendless.initApp(APPLICATION_ID, SECRET_KEY, VERSION);
function Products(args) {
args = args || {};
this.id_user = args.id_user || "";
this.cal = args.cal || null;
this.id_day = args.id_day || null;
this.id_product = args.id_product || null;
this.nameProduct = args.nameProduct || "";
}
var productStorage = Backendless.Persistence.of( Products );
var query = {
condition : "id_day = 33"
}
function get(){
try{
var product = productStorage.find(query);
}catch( e )
{
if( e.code != 1009 )
alert(e.message);
}
return product;
}
var array = get();
console.log(array);
alert(JSON.stringify(array));
i got “response: “… class”:“Products”,“id_day”:“33”,“ownerId”:null…” in XMLHttpRequest{} in console. It is what i need to get. So there is exist my information, but how to get it from responce?
But when i call alert(JSON.stringify(array)); . i get " {} ". So its empty…
if i write
alert(JSON.stringify(array.data.id_user));
i get just “undefined”.