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

Function _DeleteNodeFromIndices

src/graph/graph_hub.c:12–36  ·  view source on GitHub ↗

delete all references to a node from any relevant index

Source from the content-addressed store, hash-verified

10
11// delete all references to a node from any relevant index
12static void _DeleteNodeFromIndices
13(
14 GraphContext *gc,
15 Node *n
16) {
17 ASSERT(n != NULL);
18 ASSERT(gc != NULL);
19
20 Schema *s = NULL;
21 Graph *g = gc->g;
22 EntityID node_id = ENTITY_GET_ID(n);
23
24 // retrieve node labels
25 uint label_count;
26 NODE_GET_LABELS(g, n, label_count);
27
28 for(uint i = 0; i < label_count; i++) {
29 int label_id = labels[i];
30 s = GraphContext_GetSchemaByID(gc, label_id, SCHEMA_NODE);
31 ASSERT(s != NULL);
32
33 // update any indices this entity is represented in
34 Schema_RemoveNodeFromIndices(s, n);
35 }
36}
37
38static void _DeleteEdgeFromIndices
39(

Callers 1

DeleteNodesFunction · 0.85

Calls 2

Tested by

no test coverage detected