DomDUT
DomDUT

Reputation: 51

Obtain in array form or array a datasource on Wakanda

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

Answers (2)

DomDUT
DomDUT

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

walid chafai
walid chafai

Reputation: 106

You can convert any entity or entityCollection to array using the provided toArray method.

Example:

ds.Test.all().toArray();

documentation page

Upvotes: 1

Related Questions