Gremlin evaluating false part of traversal

75 Views Asked by At

Hi I have this snippet of my traversal that's causing some issues.

I'm using gremlin js and aws neptune.

.choose(
        token !== undefined,
        __.choose(
            __.select('v').has(`${engagementType}Token`),
                __.choose(
                    __.select('v').values(`${engagementType}Timestamp`).is(p.lt(token!.timestamp)),
                    __.select('v')
                        .property(c.single, `${engagementType}Timestamp`, token!.timestamp)
                        .property(c.single, `${engagementType}Token`, token!.id),
            ),
            __.select('v')
                .property(`${engagementType}Timestamp`, token!.timestamp)
                .property(`${engagementType}Token`, token!.id),
         ),
)

I'm getting an error indicating that timestamp is being evaluated when it's undefined. According to this traversal though it should only be evaluated when it isn't undefined.

Any idea as to what I'm missing here?

Thanks!

0

There are 0 best solutions below