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

Function _AddNodeToIndices

src/graph/graph_hub.c:55–77  ·  view source on GitHub ↗

add node to any relevant index

Source from the content-addressed store, hash-verified

53
54// add node to any relevant index
55static void _AddNodeToIndices
56(
57 GraphContext *gc,
58 Node *n
59) {
60 ASSERT(n != NULL);
61 ASSERT(gc != NULL);
62
63 Schema *s = NULL;
64 Graph *g = gc->g;
65 EntityID node_id = ENTITY_GET_ID(n);
66
67 // retrieve node labels
68 uint label_count;
69 NODE_GET_LABELS(g, n, label_count);
70
71 for(uint i = 0; i < label_count; i++) {
72 int label_id = labels[i];
73 s = GraphContext_GetSchemaByID(gc, label_id, SCHEMA_NODE);
74 ASSERT(s != NULL);
75 Schema_AddNodeToIndices(s, n);
76 }
77}
78
79// add edge to any relevant index
80static void _AddEdgeToIndices(GraphContext *gc, Edge *e) {

Callers 1

UpdateEntityPropertiesFunction · 0.85

Calls 2

Schema_AddNodeToIndicesFunction · 0.85

Tested by

no test coverage detected