I am currently working on a query that pulls a list of viewed products for a user and then pulls a list of products purchased within orders. I would like to filter the list of viewed products against the list of products purchased with orders, with the result being a list of products viewed n times that were not purchased within an order.
Note my last clause - if I test with comma separate strings, it works.
g.V('84c0cb6c-6dd4-e2bd-a3f3-1a769637636e').store('User')
.sideEffect(
outE('TRIGGERS')
.inV().as('UserSessions')
.outE('VIEWS')
.inV().as('UserWebpagesViewed')
.outE('CONTAINS')
.inV()
.groupCount()
.unfold()
.where(
select(values)
.is(gte(2))
)
.select(keys)
.store('UserMappedProducts')
)
.filter(inE('REFERS_TO').outV().inE('INSTANCE_OF').outV().outE('MAKES').inV())
.sideEffect(
inE('REFERS_TO')
.outV()
.inE('INSTANCE_OF')
.outV()
.outE('MAKES')
.inV()
.inE('PURCHASED_WITHIN')
.outV()
.id()
.fold()
.store('UserPurchasedProducts')
)
.select('UserMappedProducts')
.unfold()
.has(id, within(select('UserMappedProducts').unfold()))