Change Password

Input error
Input error
Input error
Submit

Change Nickname

Current Nickname:
Submit
Search
v4.0
    v4.0

    Insert

    Insert means to insert new node/edge data in the current GraphSet; properties carried in the data will be given the value directly, while those are not will be left as an empty string, null or 0 based on their data type.

    Insertion will insert one or multiple nodes/edges in the current GraphSet:

    • Insert nodes: specify UUID and/or ID in the data, or leave them auto-generated by the system; the operation fails if the specified UUID or ID already exists in the GraphSet.
    • Insert edges: specify UUID in the data, or leave it auto-generated by the system; the operation fails if the specified UUID already exists in the GraphSet; the operation also fails if the start/end node of the edge is not specified or if the start/end node does not exist in the GraphSet.

    Syntax:

    • Command: insert().into(@<schema>)
    • Parameter: nodes() or edges(), custom alias not supported
    • Statement Alias: Custom alias supported, structure type is NODE or EDGE
    // To insert nodes of a certain schema in the current graphset
    insert().into(@<schema>)
      .nodes([				// Square brackets can be omitted if inserts only one node
        {<property1>:<value1>, <property2>:<value2>, ...},
        {<property1>:<value1>, <property2>:<value2>, ...},
        ...
      ])
      
    // To insert edges of a certain schema in the current graphset, must carry _from and _to, or must carry _from_uuid and _to_uuid
    insert().into(@<schema>)
      .edges([				// Square brackets can be omitted if inserts only one edge
        {<property1>:<value1>, <property2>:<value2>, ...},
        {<property1>:<value1>, <property2>:<value2>, ...},
        ...
      ])
    

    Example: Insert two nodes into @account with names "Graph", "Database" and account No. U001, U002; check the UUID generated by the system

    insert().into(@account)
      .nodes([{_id: "U001", name: "Graph"}, {_id: "U002", name: "Database"}]) as nodes
    return nodes._uuid
    

    Note: In the above node insertion operation, account No. is a string and can be stored in ID.

    Example: Insert an edge into @transaction with transaction No. TRX001, amount 100, transaction time 2021-01-01 09:00:00, from card C001 to card C002; check the UUID generated by the system

    insert().into(@transaction)
      .edges({no: "TRX001", 
              _from: "C001", 
              _to: "C002", 
              amount: 100, 
              time: "2021-01-01 09:00:00"
      }) as edges
    return edges._uuid
    

    Note: In the above edge insertion operation, the transaction No. is a string and needs to be stored in a user-defined string-type property no, because ID is not supported by edges; query for user-defined properties can be sped up via index or LTE.

    Please complete the following information to download this book
    *
    公司名称不能为空
    *
    公司邮箱必须填写
    *
    你的名字必须填写
    *
    你的电话必须填写
    *
    你的电话必须填写