Manuel Garcia
Manuel Garcia

Reputation: 144

Edge of node relationated with himsef

I've just started with neo4j and NeoEloquent and I cannot get the edge (there is some important information) of a node which is related to himself.

Node referenced with himself

I add this relation like this:

UserMode.php

 public function getTech ()
    {
        return $this->belongsToMany(User::class, 'Conoce');
    }

When I try to get the edge like this:

dump(Auth::user()->getTech()->edge(Auth::user()->getTech[0]));

I get this error: Type error: Argument 1 passed to Vinelab\NeoEloquent\Eloquent\Edges\Finder::edgeFromRelationWithDirection() must be an instance of Everyman\Neo4j\Relationship, boolean given,

Thanks in advice!

Upvotes: 0

Views: 125

Answers (1)

Pat
Pat

Reputation: 409

Your question isn't clear or complete enough to be sure of the right answer. Have you tried the following?

match (u1)-[:hasMany]->(u2) return u1,u2

This should return a result for the case where u1 and u2 are the same node and that node has a relationship to itself (if I remember correctly).

Otherwise, can you update your question to clarify more of the data model you're using and the Cypher you're trying to use?

Upvotes: 0

Related Questions