Closed emredoganm closed 4 years ago
I have created a PR for this problem: #229.
This PR will generate a cypher query like this with situtation above:
dd(User::has("followers")->get());
Cypher query:
MATCH (user:`User`), (user)<-[rel_follows_user:FOLLOWS]-(related_user:`User`) WITH user, count(related_user) AS user_count WHERE user_count >= 1 RETURN user
Please confirm the fix of this in your PR to close.
@Mulkave is there some reason his suggested fix was not implemented? It is kind of embarrassing for your example code to not work.
@k98kurz this would require further testing and spectating to figure out whether it has any side effects on mapping or hydrating models, since it relies on these variables to figure out the properties.
Not sure if @emredoganm is still up for the fix?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
As mentioned in documentation here, I've created a
User
model andfollowers
relationship like this:But when I debug this query:
and echoing out
$query
fromrun() function in Vinelab\Eloquent\Connection
the result is:Target node is named as
user
and source node is named asuser
and it conflicts in Cypher and returns an empty collection. I think it is a bug. How can we solve this?