问题
I'm trying to execute a query but facing this error. Below query is the simplest form of what I was trying to achieve.
g.V('Users12345').as('u').
project('id', 'email', 'test').
by('id').
by('emailId').
by(where(values('id').is(eq(select('u').values('id')))))
I was trying to use select inside project. What's that I'm missing here?
回答1:
The invalid part is eq(select('u').values('id'))
. I guess "the query in its simplest form" means that you're aware of it being pointless. Assuming that u
is actually not the same user that's being projected, you probably want to do something more like this:
g.V('Users12345').as('u').
project('id', 'email', 'test').
by('id').
by('emailId').
by(coalesce(where(eq('u')).by('id').constant(true), constant(false)))
来源:https://stackoverflow.com/questions/54571806/gremlin-for-cosmosdb-cannot-create-valuefield-on-non-primitive-type-graphtrave