Change Password

Input error
Input error
Input error
Submit

Change Nickname

Current Nickname:
Submit
v4.0

Insertion

Insert Node

  • The Connection object provides method insertNode to insert node.
from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
conn = Connection(host='host:port', username="root", password="root")
# Insert
## Return UUIDs of the inserted nodes
ret = conn.insertNode(ULTIPA_REQUEST.InsertNode(nodes=[{'strname': 'test'}], 
					schema='test'))
## Neglect UUIDs of the inserted nodes
ret = conn.insertNode(ULTIPA_REQUEST.InsertNode(nodes=[{'strname': 'test'}], 
					schema='test', isReturnID=False))
# Overwite
ret = conn.insertNode(ULTIPA_REQUEST.InsertNode(nodes=[{'_uuid':1,'name':'test2'}], 
					schema="default", overwrite=True))
# Upsert
ret = conn.insertNode(ULTIPA_REQUEST.InsertNode(nodes=[{'_uuid':1,'name':'test1'}], 
					schema="default", upsert=True))
print(ret.toJSON())
  • The Connection object provides method insertNodesBulk to bulk insert nodes.
from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
conn = Connection(host='host:port', username="root", password="root")
# Insert
source = [{"name": 'test_insert1'},{"name": 'test_insert12'}]
ret = conn.insertNodesBulk(ULTIPA_REQUEST.InsertNodeBulk(schema="default", rows=source, 
							insertType=ULTIPA.InsertType.NORMAL))
# Overwite
source = [{"_uuid":1,"name": 'test_insert1'}]
ret = conn.insertNodesBulk(ULTIPA_REQUEST.InsertNodeBulk(schema="default", rows=source, 
							insertType=ULTIPA.InsertType.OVERWRITE))
# Upsert
source = [{"_uuid":1,"name": 'test_insert2'}]
ret = conn.insertNodesBulk(ULTIPA_REQUEST.InsertNodeBulk(schema="default", rows=source, 
							insertType=ULTIPA.InsertType.UPSERT))
print(ret.toJSON())

Insert Edge

  • The Connection object provides method insertEdge to insert edge.
from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
conn = Connection(host='host:port', username="root", password="root")
# Insert
## Return UUIDs of the inserted edges
ret = conn.insertEdge(ULTIPA_REQUEST.InsertEdge(edges=[{'_from_uuid': 1, '_to_uuid': 2}], 
					schema="default"))
## Neglect UUIDs of the inserted edges
ret = conn.insertEdge(ULTIPA_REQUEST.InsertEdge(edges=[{'_from_uuid': 1, '_to_uuid': 2}], 
					schema="default",isReturnID=False))
# Overwite
ret = conn.insertEdge(ULTIPA_REQUEST.InsertEdge(edges=[{'_uuid':1,'_from_uuid': 1, 
					'_to_uuid': 2,'name':'test1'}], overwrite=True, schema="default"))
# Upsert
ret = conn.insertEdge(ULTIPA_REQUEST.InsertEdge(edges=[{'_uuid':1,'_from_uuid': 1, 
					'_to_uuid': 2,'name':'test1'}], upsert=True, schema="default"))
print(ret.toJSON())
  • The Connection object provides method insertEdgesBulk to bulk insert edges.
from ultipa import Connection,ULTIPA_REQUEST, ULTIPA
conn = Connection(host='host:port', username="root", password="root")
# Insert
source = [{'_from_uuid': 1, '_to_uuid': 2,'name':'test'}]
ret = conn.insertEdgesBulk(ULTIPA_REQUEST.InsertEdgeBulk(schema="default", rows=source, 
							insertType=ULTIPA.InsertType.NORMAL))
# Overwite
source = [{"_uuid":1,'_from_uuid': 1, '_to_uuid': 2,'name':'test'}]
ret = conn.insertEdgesBulk(ULTIPA_REQUEST.InsertEdgeBulk(schema="default", rows=source, 
							insertType=ULTIPA.InsertType.OVERWRITE))
# Upsert
source = [{"_uuid":1,'_from_uuid': 1, '_to_uuid': 2,'name':'test'}]
ret = conn.insertEdgesBulk(ULTIPA_REQUEST.InsertEdgeBulk(schema="default", rows=source, 
							insertType=ULTIPA.InsertType.UPSERT))
print(ret.toJSON())
Please complete the following information to download this book
*
公司名称不能为空
*
公司邮箱必须填写
*
你的名字必须填写
*
你的电话必须填写
*
你的电话必须填写