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();
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();