There is documentation on how to provide default values for base data types, but what about providing them for a set? What is the best way to invoke something like this
CREATE QUERY zMarkTest(SET< STRING > codes)
where most of the time I have a predetermined set of codes I want to use.
You are probably thinking that I can just call it from the command line or python and provide the codes at runtime, but I would like to know how to establish defaults within the query definition. The main reason I want to use a set is so that I can use the IN predicate within the query.
MATCH = SELECT c FROM Procedures:c WHERE c.procedureCode IN codes;
thanks
1 Like
I think you could possibly take in a LIST as the parameter and it would get you the desired behavior, but I haven’t done that before so I am not 100%.
1 Like
I was also searching and trying out few combinations for the same. But I dont think so it is supported. @Xinyu_Chang can confirm. One way of doing it is to take a delimited string and to split it.
Giving default value for collection type parameters is not supported yet.
BTW, MATCH = SELECT c FROM Procedures:c WHERE c.procedureCode IN codes;
If procedureCode happens to be the ID of Procedures it will be a lot faster if you do this:
CREATE QUERY zMarkTest(SET< vertex > codes)
MATCH = codes;
3 Likes