本文介绍了Gremlin for CosmosDB-无法在非原始类型GraphTraversal上创建ValueField的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试执行查询,但遇到此错误.下面的查询是我要实现的最简单的形式.
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')))))
我试图在项目内部使用select.我在这里想念什么?
I was trying to use select inside project. What's that I'm missing here?
推荐答案
无效部分是 eq(select('u').values('id'))
.我猜最简单形式的查询"意味着您意识到它毫无意义.假设 u
实际上不是所投影的用户,则您可能想做更多类似的事情:
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)))
这篇关于Gremlin for CosmosDB-无法在非原始类型GraphTraversal上创建ValueField的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!