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

Method create_node

demo/client/client.py:40–59  ·  view source on GitHub ↗

Creates a new node, specify node properties within args where args[i] i%2=0 is the prop name, and i%2=1 is prop value

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

38 self.redis_con = redis_con
39
40 def create_node(self, *args, **kwargs):
41 """
42 Creates a new node, specify node properties
43 within args where args[i] i%2=0 is
44 the prop name, and i%2=1 is prop value
45 """
46 label = kwargs["label"]
47 if label:
48 node_id = self.redis_con.execute_command(
49 "GRAPH.CREATENODE",
50 self.graph,
51 label,
52 *args)
53 else:
54 node_id = self.redis_con.execute_command(
55 "GRAPH.CREATENODE",
56 self.graph,
57 *args)
58
59 return Node(node_id, label=label, *args)
60
61 def connect_nodes(self, src_node, relation, dest_node, *args):
62 """

Callers

nothing calls this directly

Calls 1

NodeClass · 0.70

Tested by

no test coverage detected