Page 1 of 1

How to parse array of objects in server scripting environment

Posted: Sun Apr 20, 2014 1:17 am
by Tom Mccann

I need someone to answer this who knows about the server scripting environment.

I have a server script that makes a successful query to the backend mongo database. The query brings back 2 documents as I expected. So far so good.

If I try to use any of the usual methods to parse the results then the server throws an exception. So far, I've tried to use:

forEach to iterate the array.
JSON.parse

The server exception is as follows:

forEach is not defined, ncode: undefined
JSON is not defined, ncode: undefined

That means that the server environment does't recognise these javascript methods. So my question is:

What method does the server scripting environment support for parsing an array of objects?


How to parse array of objects in server scripting environment

Posted: Sun Apr 20, 2014 2:11 am
by Igor

Hello,

Did you follow this doc ?
http://docs.appery.io/documentation/b...

Also please take a look here:
https://developer.mozilla.org/en-US/d...

Could you show us your full script?