Gremlin for CosmosDB - Cannot create ValueField on non-primitive type GraphTraversal

谁说胖子不能爱 提交于 2021-01-29 18:34:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!