OrientDB javascript function, "save" on getDataBase not working -
i'm following tutorial http://pettergraff.blogspot.fr/2014/01/getting-started-with-orientdb.html
and on fourth part, we're suppose create javascript function push "members" in database.
i know tutorial old , i've been through issues, instance had delete block
<handler class="com.orientechnologies.orient.graph.handler.ographserverhandler"> <parameters> <parameter value="true" name="enabled"/> <parameter value="50" name="graph.pool.max"/> </parameters> </handler>
from orientdb-server-config.xml, make following code work :
var db = orient.getdatabase();
is normal?
now line okay, i'm having trouble, here "my" code :
var db = orient.getdatabase(); db.begin(); (var = 0; < n; i++) { var name = prefix + "_" + i; var email = name + "@gmail.com"; var member = { "@class": "member", "name": "robin", "password": "robin", "email": "robin" }; var result = odocument.save(member); } db.commit(); return 0;
the problem on "save" method
var result = db.save(member);
it's saying method ambigus, don't know :)
here error (in french, i'd in english didn't find out how change de language on orientdb interface)
erroronparsingscriptatposition#0: erroronexecutionofthescriptscript: createsomemembers------^sun.org.mozilla.javascript.evaluatorexception: lechoixdelaméthodejavacom.orientechnologies.orient.core.command.script.oscriptdocumentdatabasewrapper.savecorrespondantauxtypesd'argumentjavascript(object)estambigu.lesméthodesproposéessontlessuivantes???: classcom.orientechnologies.orient.core.record.impl.odocumentsave(com.orientechnologies.orient.core.record.orecord)classcom.orientechnologies.orient.core.record.impl.odocumentsave(java.util.map)(<unknownsource>#18)in<unknownsource>atlinenumber18lechoixdelaméthodejavacom.orientechnologies.orient.core.command.script.oscriptdocumentdatabasewrapper.savecorrespondantauxtypesd'argumentjavascript(object)estambigu.lesméthodesproposéessontlessuivantes???: classcom.orientechnologies.orient.core.record.impl.odocumentsave(com.orientechnologies.orient.core.record.orecord)classcom.orientechnologies.orient.core.record.impl.odocumentsave(java.util.map)(<unknownsource>#18)
does knows do? thank !
something quite equivalent using graph api:
var db = orient.getgraph(); var member = db.addvertex("class:member"); member.setproperty("name", "robin"); member.setproperty("password", "robin"); db.commit(); return;
Comments
Post a Comment