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

[[relate]] two way relation #429

Closed
kbonevska opened this issue Sep 9, 2020 · 2 comments
Closed

[[relate]] two way relation #429

kbonevska opened this issue Sep 9, 2020 · 2 comments

Comments

@kbonevska
Copy link

Hello there, admirations for the project, amazing work.

We have the following relation mapping in our config, but it seems it is causing an endless loop of updates in the elastic.
Is it possible to do such relation with [[relate]]?

direct-read-namespaces = ["authors","articles"]
change-stream-namespaces = ["authors","articles"]
resume-strategy = 1

[[relate]]
namespace = "authors"
with-namespace = "articles"
src-field = "topicID"
match-field = "topicID"
keep-src = true

[[relate]]
namespace = "articles"
with-namespace = "authors"
src-field = "topicID"
match-field = "topicID"
keep-src = true

@rwynn
Copy link
Owner

rwynn commented Sep 9, 2020

hi @kbonevska thank you. can you try setting the max-depth property of the relate?

[[relate]]
namespace = "authors"
with-namespace = "articles"
src-field = "topicID"
match-field = "topicID"
keep-src = true
max-depth = 1

[[relate]]
namespace = "articles"
with-namespace = "authors"
src-field = "topicID"
match-field = "topicID"
keep-src = true
max-depth = 1

It probably should be detecting cycles like this. I will look into that for the next release.

@kbonevska
Copy link
Author

it is working now, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants