danielcraig23
ATApache TinkerPop
•Created by danielcraig23 on 5/9/2024 in #questions
Is the insertion order guaranteed with this example code?
Ok thank you!!
13 replies
ATApache TinkerPop
•Created by danielcraig23 on 5/9/2024 in #questions
Is the insertion order guaranteed with this example code?
for 3.6.2 is this also the case?
13 replies
ATApache TinkerPop
•Created by danielcraig23 on 5/9/2024 in #questions
Is the insertion order guaranteed with this example code?
@Valentyn Kahamlyk does gtx....iterate() have a strategy for maintaining the order of these writes?
13 replies
ATApache TinkerPop
•Created by danielcraig23 on 5/9/2024 in #questions
Using mergeE to create an edge with an id that depends on a lookup
Thank you @spmallette !
8 replies
ATApache TinkerPop
•Created by danielcraig23 on 5/9/2024 in #questions
Is the insertion order guaranteed with this example code?
Is this an acceptable way of making sequential writes? I am using async.retry to retry the promise returned by tx.commit(), similar to this example from Amazon: https://docs.aws.amazon.com/neptune/latest/userguide/lambda-functions-examples.html#lambda-functions-examples-javascript
```
const tx = g.tx();
try {
// get the graph traversal source from the transaction
const gtx = tx.begin();
gtx.addV("owner").property(id, "1111").iterate() gtx.addV("laptop").property(id, "macbookAir2024").property("yearReleased", 2024).iterate() gtx.V() .hasLabel('laptop') .has(t.id, textP.startingWith(partialMacbookId)) .order() .by('yearReleased', desc) .limit(1) .as("mostRecentMacbook") .mergeE( new Map([ [t.label, 'hasOwner'], [direction.out, merge.outV], [direction.in, merge.inV]] ) ) .option(merge.outV, .select('mostRecentMacbook')) .option(merge.inV, .V(ownerId)) .iterate(); return tx.commit(); } catch (error) { logger.error(error); // roll back the transaction return tx.rollback(); }
gtx.addV("owner").property(id, "1111").iterate() gtx.addV("laptop").property(id, "macbookAir2024").property("yearReleased", 2024).iterate() gtx.V() .hasLabel('laptop') .has(t.id, textP.startingWith(partialMacbookId)) .order() .by('yearReleased', desc) .limit(1) .as("mostRecentMacbook") .mergeE( new Map([ [t.label, 'hasOwner'], [direction.out, merge.outV], [direction.in, merge.inV]] ) ) .option(merge.outV, .select('mostRecentMacbook')) .option(merge.inV, .V(ownerId)) .iterate(); return tx.commit(); } catch (error) { logger.error(error); // roll back the transaction return tx.rollback(); }
13 replies
ATApache TinkerPop
•Created by danielcraig23 on 4/18/2024 in #questions
.mergeV() with Javascript not working
The solution was to allow neptune to use the default mimetype; removing the mimetype header solved the issue
28 replies
ATApache TinkerPop
•Created by danielcraig23 on 5/9/2024 in #questions
Is the insertion order guaranteed with this example code?
Yes that's certainly true, for reasons of breaking up a series of several long .mergeV() and .mergeE()'s I want to use a transaction so that there's space in between.
13 replies
ATApache TinkerPop
•Created by danielcraig23 on 5/9/2024 in #questions
Using mergeE to create an edge with an id that depends on a lookup
I'm using Tinkerpop 3.6.2, where .concat() and .format() weren't yet added, and I'm using Neptune where lambdas aren't supported
8 replies
ATApache TinkerPop
•Created by danielcraig23 on 5/9/2024 in #questions
Using mergeE to create an edge with an id that depends on a lookup
8 replies
ATApache TinkerPop
•Created by danielcraig23 on 5/9/2024 in #questions
Using mergeE to create an edge with an id that depends on a lookup
Here is the script that I'm testing in gremlin console:
8 replies
ATApache TinkerPop
•Created by danielcraig23 on 5/8/2024 in #questions
Is tx.close() necessary in Javascript?
Thanks Valentyn
6 replies
ATApache TinkerPop
•Created by danielcraig23 on 5/8/2024 in #questions
Is tx.close() necessary in Javascript?
6 replies
ATApache TinkerPop
•Created by danielcraig23 on 4/18/2024 in #questions
.mergeV() with Javascript not working
Thank you!
28 replies
ATApache TinkerPop
•Created by danielcraig23 on 4/18/2024 in #questions
.mergeV() with Javascript not working
I provided some more details in an amazon case which I just created, can I send you that case #?
28 replies
ATApache TinkerPop
•Created by danielcraig23 on 4/18/2024 in #questions
.mergeV() with Javascript not working
ooh nice that's what I want to see
28 replies
ATApache TinkerPop
•Created by danielcraig23 on 4/18/2024 in #questions
.mergeV() with Javascript not working
so the problem remains
28 replies
ATApache TinkerPop
•Created by danielcraig23 on 4/18/2024 in #questions
.mergeV() with Javascript not working
So it seems that the map was populated after all, and my logging was just representing it as {}.
28 replies
ATApache TinkerPop
•Created by danielcraig23 on 4/18/2024 in #questions
.mergeV() with Javascript not working
Now I've updated my function to
and the logs show
28 replies
ATApache TinkerPop
•Created by danielcraig23 on 4/18/2024 in #questions
.mergeV() with Javascript not working
I'm not sure what
/* @__PURE__ */
means28 replies
ATApache TinkerPop
•Created by danielcraig23 on 4/18/2024 in #questions
.mergeV() with Javascript not working
As deployed in Lambda the code appears like this:
28 replies