I try to write a function that return a value of a document like this. I
just want to get id = 1 as first entry:
var gdb = orient.getGraph();
var roles = gdb.command("sql","select from Author");
roles.forEach(function(record) {
var a = eval(record)[0].id;
return a;
});
Error is:
Error on parsing script at position #0: Error on execution of the script
Script: test2
------^
sun.org.mozilla.javascript.internal.EvaluatorException: Java class
"com.tinkerpop.blueprints.impls.orient.OrientVertex" has no public instance
field or method named "0". (<Unknown source>#12) in <Unknown source> at
line number 12
Java class "com.tinkerpop.blueprints.impls.orient.OrientVertex" has no
public instance field or method named "0". (<Unknown source>#12)
Also tried
JSON.parse
but also got errors.
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.