Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Unrelating a relation #1363

Closed
2 tasks done
IngwiePhoenix opened this issue Oct 14, 2022 · 3 comments
Closed
2 tasks done

Documentation: Unrelating a relation #1363

IngwiePhoenix opened this issue Oct 14, 2022 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@IngwiePhoenix
Copy link

Description

So once you did

RELATE user:ingwie->likes->post:abcdef;

...how do you un-relate?

I first thought of making this a feature request for an UNRELATE keyword, but I am pretty sure there is an existing way to this. And, I would love this to be documented. :)

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@IngwiePhoenix IngwiePhoenix added documentation Improvements or additions to documentation triage This issue is new labels Oct 14, 2022
@coldino
Copy link

coldino commented Oct 14, 2022

This is asked frequently so I'm looking forward to it being documented.

The relation is basically just a table called likes with an in and an out so you can delete it as normal:

DELETE likes WHERE in=user:ingwie AND out=post:abcdef;

But as pointed out in this Discord post from Tobie, it's more efficient to use the relation itself to find the links to delete:

DELETE FROM user:ingwie->likes WHERE out=post:abcdef;

There are plenty more examples in the Discord until the docs are fully fleshed out!

As an aside, you can use the fact that it's just a table to make it SCHEMAFULL and restrict the relation types.

@IngwiePhoenix
Copy link
Author

Oh believe me, last night I went ham on those =) I am quite aware of them just being a table and was trying out if I can relate just one or many types or... well, let's just say I experimented a good few hours on this feature alone!

Thanks for sharing the example; feels honestly a little unintuitive compared to just a plain UNRELATE keyword. But, this'll do untill then!

@tobiemh tobiemh removed the triage This issue is new label Mar 26, 2023
@postmeback
Copy link

I believe this issue can be closed.

@kearfy kearfy closed this as completed Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants