monstache icon indicating copy to clipboard operation
monstache copied to clipboard

[[relate]] doesn't work for updating or syncing the multiple joined views

Open srilekhaMarktine123 opened this issue 2 years ago • 1 comments

@rwynn this is one of the excellent project which I implemented in project.

However, I have requirement where I have to join couple of collections and created a final view but unable to use relate as I create final view after doing several joins.

Something like collection A_col and B_col joined to create view A_view and then joined collection C_col with view A_view to create another view B_view . So this B_view how do I use relate function to create index in elasticsearch? Can you give me some approach to make this work. I need it very urgently to implement this in our code. Your response is much appreciated. Thanks in advance.

srilekhaMarktine123 avatar Sep 16 '22 13:09 srilekhaMarktine123

Hi @srilekhaMarktine123!

You could try to relate your final view ("B_view") to all the three collections:

[[relate]]
keep-src = false
namespace = "db.A_col"
match-field = "_id"
with-namespace = "db.B_view"
src-field = "A_foreignId"

[[relate]]
keep-src = false
namespace = "db.B_col"
match-field = "_id"
with-namespace = "db.B_view"
src-field = "B_foreignId"

[[relate]]
keep-src = false
namespace = "db.C_col"
match-field = "_id"
with-namespace = "db.B_view"
src-field = "C_foreignId"

oliveiracdz avatar Sep 20 '22 22:09 oliveiracdz