Skip to content Skip to sidebar Skip to footer

Embedding Record From Function In Orientdb

I'd like to embed a record into another one using a function in OrientDB. I have a class called Backup. Here's it's definition: create class Backup extends V create property Backup

Solution 1:

OrientDB - v2.0.6

var graph = orient.getGraphNoTx();

var query = "select @this.exclude('@rid').toJson() as json from V where @rid = " + id;
var result = graph.command("sql", query);

var command = "create vertex Backup " 
            + "set dateTime = " + new Date().getTime() + ", "
            + "    record   = " + result[0].getRecord().field('json');    
graph.command("sql", command);

return;

Post a Comment for "Embedding Record From Function In Orientdb"