MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / Map_Add

Function Map_Add

src/datatypes/map.c:96–113  ·  view source on GitHub ↗

adds key/value to map

Source from the content-addressed store, hash-verified

94
95// adds key/value to map
96void Map_Add
97(
98 SIValue *map,
99 SIValue key,
100 SIValue value
101) {
102 ASSERT(SI_TYPE(*map) & T_MAP);
103 ASSERT(SI_TYPE(key) & T_STRING);
104
105 // remove key if already existed
106 Map_Remove(*map, key);
107
108 // create a new pair
109 Pair pair = Pair_New(key, value);
110
111 // add pair to the end of map
112 array_append(map->map, pair);
113}
114
115// removes key from map
116void Map_Remove

Callers 8

AR_TOMAPFunction · 0.85
AR_MERGEMAPFunction · 0.85
GraphEntity_PropertiesFunction · 0.85
_EmitIndexFunction · 0.85
Map_CloneFunction · 0.85
test_map_addFunction · 0.85
test_map_removeFunction · 0.85
test_map_tostringFunction · 0.85

Calls 2

Map_RemoveFunction · 0.85
Pair_NewFunction · 0.85

Tested by 3

test_map_addFunction · 0.68
test_map_removeFunction · 0.68
test_map_tostringFunction · 0.68