I'm using cube.js with MongoDB through MongoDB Connector for BI and MongoBI Driver and so far so good. I'd like to have a cube.js numerical measure that counts the element length from a MongoDB array of object nested property. Something like:
{
"nested": {
"arrayPropertyName": [
{
"name": "Leatha Bauch",
"email": "Leatha.Bauch76@hotmail.com"
},
{
"name": "Pedro Hermiston",
"email": "Pedro76@hotmail.com"
}
]
}
}
I wasn't able to figure that out looking at the docs and I was wondering if that is even possible.
I tried with type: count
:
MyNestedArrayPropertyCounter: {
sql: `${CUBE}.\`nested.arrayPropertyName\``,
type: `count`,
format: `number`,
},
but I'm getting
Error: Error: Unknown column 'nested.arrayPropertyName' in 'field list'
Any help/advice is really appreciated. Thanks