Neo4jClient returns 403 FORBIDDEN: Request forbidden by administrative rules

When trying to add a relationship between two nodes in a neo4j instance using Neo4jClient, I get the following error: Request forbidden by administrative rules.

public async Task CreateFollowship(Guid followerId, Guid followedId)
    {
        await _neo4jClient.ConnectAsync();

        await _neo4jClient.Cypher
            .Match("(follower:User)", "(followed:User)")
            .Where($"(User follower) => follower.Id == {followerId}")
            .AndWhere($"(User followed) => followed.Id == {followedId}")
            .Create("follower-[:FOLLOWS]->followed")
            .ExecuteWithoutResultsAsync();
    }

I've been following this documentation, isn't it outdated, is it? What am i doing wrong?

The query generated is (by example):

MATCH (follower:User), (followed:User) WHERE (User follower) => follower.Id == "970486dc-5430-4532-8ed3-e30efa930105" AND (User followed) => followed.Id == "f6a15b31-e328-4113-8541-3de8108b116d" CREATE follower-[:FOLLOWS]->followed

I tried in other ways:

MATCH (follower:User), (followed:User) WHERE follower.Id == "970486dc-5430-4532-8ed3-e30efa930105" AND followed.Id == "f6a15b31-e328-4113-8541-3de8108b116d" CREATE follower-[:FOLLOWS]->followed
MATCH (follower:User), (followed:User) WHERE follower.Id IS "970486dc-5430-4532-8ed3-e30efa930105" AND followed.Id IS "f6a15b31-e328-4113-8541-3de8108b116d" CREATE follower-[:FOLLOWS]->followed

...

When running the command on the Neo4j Console using Cypher, i get different syntax errors with every attempt to fix. What is the correct syntax? An incorrect syntax is really the reason for the 403 error?

Upvotes: 1

Views: 230

Answers (0)

Related Questions