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

Function GraphEntity_Properties

src/graph/entities/graph_entity.c:66–81  ·  view source on GitHub ↗

returns a map containing all the properties in the given node, or edge.

Source from the content-addressed store, hash-verified

64
65// returns a map containing all the properties in the given node, or edge.
66SIValue GraphEntity_Properties
67(
68 const GraphEntity *e
69) {
70 GraphContext *gc = QueryCtx_GetGraphCtx();
71 const AttributeSet set = GraphEntity_GetAttributes(e);
72 int propCount = AttributeSet_Count(set);
73 SIValue map = SI_Map(propCount);
74 for(int i = 0; i < propCount; i++) {
75 Attribute_ID attr_id;
76 SIValue value = AttributeSet_GetIdx(set, i, &attr_id);
77 const char *key = GraphContext_GetAttributeString(gc, attr_id);
78 Map_Add(&map, SI_ConstStringVal(key), value);
79 }
80 return map;
81}
82
83// prints the attribute set into a buffer, returns what is the string length
84// buffer can be re-allocated if needed

Callers 1

AR_PROPERTIESFunction · 0.85

Calls 8

QueryCtx_GetGraphCtxFunction · 0.85
AttributeSet_CountFunction · 0.85
SI_MapFunction · 0.85
AttributeSet_GetIdxFunction · 0.85
Map_AddFunction · 0.85
SI_ConstStringValFunction · 0.85

Tested by

no test coverage detected