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

Function UpdateEntityProperties

src/graph/graph_hub.c:223–248  ·  view source on GitHub ↗

updates a graph entity attribute set. Returns as out params the number of properties set and removed.

Source from the content-addressed store, hash-verified

221// updates a graph entity attribute set. Returns as out params the number
222// of properties set and removed.
223void UpdateEntityProperties
224(
225 GraphContext *gc, // graph context
226 GraphEntity *ge, // updated entity
227 const AttributeSet set, // new attributes
228 GraphEntityType entity_type, // entity type
229 bool log // log update in undo-log
230) {
231 ASSERT(gc != NULL);
232 ASSERT(ge != NULL);
233
234 AttributeSet old_set = GraphEntity_GetAttributes(ge);
235
236 if(log == true) {
237 UndoLog log = QueryCtx_GetUndoLog();
238 UndoLog_UpdateEntity(log, ge, old_set, entity_type);
239 }
240
241 *ge->attributes = set;
242
243 if(entity_type == GETYPE_NODE) {
244 _AddNodeToIndices(gc, (Node *)ge);
245 } else {
246 _AddEdgeToIndices(gc, (Edge *)ge);
247 }
248}
249
250void UpdateNodeProperty
251(

Callers 1

CommitUpdatesFunction · 0.85

Calls 5

QueryCtx_GetUndoLogFunction · 0.85
UndoLog_UpdateEntityFunction · 0.85
_AddNodeToIndicesFunction · 0.85
_AddEdgeToIndicesFunction · 0.85

Tested by

no test coverage detected