Reputation: 51
I would like to know if it's possible to obtain in array form or array a datasource on Wakanda to process data more easily on JavaScript.
Upvotes: 1
Views: 81
Reputation: 51
Firstly, thanks for the answer, i have already use this method but when i load my page, the page crash.
Server-side :
exports.myDataArray = function arrayDom()
{
var myArray = ds.myTable.all().toArray();
return myArray;
}
client-side
var myNewArray myModule.myDataArray();
console.log(myNewArray);
=>>> CRASH
Or when i have chance i obtain in the console :
() function{
var result = '',
message = {},
request = {},
i = 0;
request = new WAF.proxy.HttpRequest ({
url :…
or console.log(myNewArray[10])
=> UNDEFINED
Upvotes: 1
Reputation: 106
You can convert any entity or entityCollection to array using the provided toArray
method.
Example:
ds.Test.all().toArray();
Upvotes: 1