jbmusso / grex

JavaScript graph database client for TinkerPop2 Rexster
MIT License
46 stars 12 forks source link

Vertex returned server-side script can't be used in a transaction #59

Open ek-nath opened 9 years ago

ek-nath commented 9 years ago

I'd like to use a server-side function getOrCreateNode to return a vertex and use it to add an Edge. with something like:

var query = gremlin();
query.var('getOrCreateNode(g, "user_id", "first")', 'v1');
query.var('getOrCreateNode(g, "user_id", "second")', 'v2');
query(g.addEdge('v1', 'v2', 'label', {prop1: 'something'}));
query.var('getOrCreateNode(g, "user_id", "first")', 'v1');
returns
TypeError: Cannot assign to read only property 'identifier' of getOrCreateNode(g, "user_id", "first")
    at GremlinScript.var (/home/goat/code/FS_sync_data_dumper/node_modules/grex/node_modules/gremlin-script/src/gremlinscript.js:90:22)
PS: I am using the latest version in npm