Clearing map attribute

I want to clear the map on an attribute without having to replace it with an meaningless (k,v).

What I want to do:

CREATE QUERY clear_filter_map() FOR GRAPH my_graph { 
all_verts = {vertex_name.*};	
clear_all = SELECT src FROM all_verts:src POST-ACCUM src.filter_map.clear();
}

What I have to do for now:

CREATE QUERY clear_filter_map() FOR GRAPH my_graph { 
all_verts = {vertex_name.*};
UPDATE src FROM all_verts:src SET src.filter_map =(""->0);
}

Thank you, @xinyu

Solution:

CREATE QUERY clear_filter_map() FOR GRAPH my_graph {
MapAccum<String, int> @@map;
all_verts = {vertex_name.*};
UPDATE src FROM all_verts:src SET src.filter_map = @@map;
}
1 Like