Hi Team,
I would like to pass the vertex attribute dynamically to use in the where clause. Like below example. Please let me know if there is any way
CREATE QUERY autocomplete_property_search(string searchterm, string property, set labelnames) FOR GRAPH movies syntax v2{
MapAccum<STRING, SetAccum> @@nodeids;
string vall;
vall = “%”+ searchterm + “%”;
start = {ANY} ;
if labelnames.size() > 0 then
pp = select p from start:p where p.type in labelnames and p.property like vall;
ELSE
pp = select p from start:p where p.property like vall;
end;
print @@nodeids;
}
The error says "No type can be inferred for “p.property”. I would like to send the attribute name to query as input. In this case if I send property = Name, the query should do filtering on p.Name like vall;