Search code examples
orientdb

OrientDB - JavaScript delete function


I wanna delete record using JS API. In wiki I found example and I know that exist delete() function but I don't know what paramets needed and can't find documentation about ORid realize interface.

Update

When I create or insert function I get error

Internal server error: java.lang.IllegalArgumentException: Script pool for database 'myDataBase' is not configured

I use this code:

db.save()

//or

db.executeCommand()

Need help. Maybe who know. Thanks


Solution

  • You can use this code for a graph database

    var g=orient.getGraph();
    var vertex=g.getVertex("your rid");
    vertex.getRecord().delete();
    

    and this for a document database

    var db=orient.getDatabase();
    var document=db.query("select from #21:0");
    document[0].delete();
    

    Hope it helps