How to Perfrom Where Filter in Gremlin queries

戏子无情 提交于 2020-07-23 06:51:17

问题


where(​
 and​
 (​
choose(constant(0).is(1),​
select('WorkLocation'). is(within('Not Updated')),​
select('WorkLocation')),​
​
choose(constant(1).is(1),​
select('Status'). is(within('Red', 'Orange')),​
select('Status')),​
​
choose(constant(0).is(1),​
select('ConfirmationDate'). is(between(637281491635663900, 637258237221895200)),​
select('ConfirmationDate'))​
 )​
)

In the Above Where condition Query, I have to do a filter on three fields WorkLocation, Status, ConfirmationDate, I have used choose function because if from UI any parameters come blanks then else part will execute or the parameters will execute in a true condition. In this I have passed a flag value in constant function to get executed specifically when it has value then the true condition will be executed or else part with all value. In Gremlin Null Is not supported, I just want to do filter without using any constant function where if any parameters if passed then the true condition should execute with those parameters else no parameters then all the values should be displayed on the screen.

来源:https://stackoverflow.com/questions/62515164/how-to-perfrom-where-filter-in-gremlin-queries

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