Change Password

Input error
Input error
Input error
Submit

Change Nickname

Current Nickname:
Submit
Search
v4.0
    v4.0

    difference() | Array Difference

    Parameters, Value

    Array Difference function calculates the elements exist in array1 but not in array2, and returns them as array (repeated elements are allowed within the arrays).

    If array1 and array2 are not homologous: when used in WITH, intersection() will first make a Cartesian Product Combination of all columns and its homologous columns before calculation; when used in RETURN, intersection() will trim all columns and their homologous columns before calculation.

    Syntax:

    • Format: difference(<array1>, <array2>)
    • Parameters: see table below
    • Value: ARRAY
    Name Category Specification Description
    array1 ARRAY / the 1st array
    array2 ARRAY / the 2nd array

    Common Usage

    Example: Find the neighbors of Card CA001, and remove the nodes that are also neighbors of Card CA002, and return as array

    khop().src({_id == "CA001"}).depth(1) as n1
    khop().src({_id == "CA002"}).depth(1) as n2
    with collect(n1) as a1, collect(n2) as a2
    return difference(a1, a2)
    
    Please complete the following information to download this book
    *
    公司名称不能为空
    *
    公司邮箱必须填写
    *
    你的名字必须填写
    *
    你的电话必须填写
    *
    你的电话必须填写