问题
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