Neoism golang 密码查询结果

result of cypher query on neoism golang

我有删除 "User" 节点和 return 计数删除节点的功能,但它总是 return -1.

func DeleteUser(userid int) (int, error) {
        stmt := `
        MATCH (u:User) WHERE u.userId = {userid} delete u RETURN count(u) ;
        `
        params := neoism.Props{"userid": userid}
        res := -1
        cq := neoism.CypherQuery{
            Statement:  stmt,
            Parameters: params,
            Result:     &res,
        }

        err := conn.Cypher(&cq)

        return res, err
    }

1) res 必须是 []struct

类型

2) 不要使用“;”在查询结束时。 stmt := MATCH (u:User) WHERE u.userId = {userid} delete u RETURN count(u)