I am new to cube.js and I am facing a problem, maybe someone will be able to help me. I did not find anything very helpful on the internet... Here is an example of o document in my collection:
{
"_id" : ObjectId("5a835e0000f73b69c100f15c"),
"studyDescription" : "xxxxxxxx",
"observations" : [
{
"_id" : "1JELIZY6QSAGW",
"state" : "validated",
"stateBy" : "user@xxx.com",
"stateAt" : ISODate("2019-10-22T15:06:48.133+0000"),
"created" : ISODate("2019-10-22T15:06:48.133+0000"),
"createdBy" : "user@xxx.com",
"history" : [
{
"author" : "user@xxx.com",
"role" : "ADMIN",
"state" : "validated",
"tsp" : ISODate("2019-10-22T15:06:48.133+0000")
}
]
}
]
}
My collection contains studies and each study contains several observations. Each observation can be reviewed by one or several reviewers and this information is contained in "history" array. I need to do some reporting so I was advised to use cube.js. Problem is I need to filter some of my charts with data contained in arrays and to do so, i need to do some joins. My problem is that the "observations" array does not contain the study id and the "history" array does not contain either study id nor observations id whereas I would need both to join the tables and filter according to the author for example. I can't join them except if I modify the collection in the database to add the information, which is unfortunately not an option in my case...
Would you have an idea to make this join possible ?
Thank you very much for your help