Platform.api not working in NodeJS scripts to access Mongo

I’m trying to issue a request from a NodeJS service in DF 2.2.1 like platform.api.get("mongodb/_table/myTable") but the script seems to crash without any other clue but returning the message "Executed command returned with error code: 1"

I understand that platform.api.get() is supported in NodeJS, right?

Any idea why this may happen?

Thanks in advance.

Ok, I found the problem: NodeJS syntax is different from V8 and the data is received via callback.

For examples, see


I’m trying to do a patch to a table and get stucked: when i do it through APIDocs, it work well, but when i try patch inside a server-side script, it returns:

{“error”:{“code”:400,“context”:null,“message”:“The request contains no valid record fields.”,“status_code”:400}}

I set a var_dump of the request on the pre-patch event and when i run the patch from the APIDocs, it shows the payload, but when i run from the script, it shows nothing inside the payload… what should be happening?

Any thoughs? thanks in advance.