Deletion

6.1 Delete Node

  • Delete by node id:

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.deleteNode(ULTIPA_REQUEST.DeleteNode(id=3))
    print(ret.toJSON())
    
  • Delete by node filter:

    from ultipa import Connection,ULTIPA_REQUEST,FILTER
    conn = Connection(host='host:port', username="root", password="root")
    ufilter = FILTER.EqFilter(name='age', value=20)
    ret = conn.deleteNode(ULTIPA_REQUEST.DeleteNode(filter=ufilter))
    print(ret.toJSON())
    

6.2 Delete Edge

  • Delete by edge id:

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.deleteEdge(ULTIPA_REQUEST.DeleteEdge(id=3))
    print(ret.toJSON())
    
  • Delete by edge filter:

    from ultipa import Connection,ULTIPA_REQUEST,FILTER
    conn = Connection(host='host:port', username="root", password="root")
    ufilter = FILTER.EqFilter(name='rank', value=12)
    ret = conn.deleteEdge(ULTIPA_REQUEST.DeleteEdge(filter=ufilter))
    print(ret.toJSON())
    

6.3 Truncate Data

  • Truncate node
    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.truncate(request=ULTIPA_REQUEST.Truncate(ULTIPA.TruncateType.NODE))
    print(ret.toJSON())
    
  • Truncate edge
from ultipa import Connection,ULTIPA_REQUEST
conn = Connection(host='host:port', username="root", password="root")
ret = conn.truncate(request=ULTIPA_REQUEST.Truncate(ULTIPA.TruncateType.EDGE))
print(ret.toJSON())
  • Truncate node and edge
    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.truncate(request=ULTIPA_REQUEST.Truncate(all=True))
    print(ret.toJSON())