Sub Array Of Mongodb

Can I acces The element of Inner array of mongodb for create Virtual dashboard?
For example
{
“data”:[{
“firstName”:“Rinks”,
“LastName”:“Kalathiya”
},
{
“firstName”:“ABC”,
“LastName”:“XYZ”
} ]
}

I ran into the same issue and was not able to figure out how to access the inner array. That said, I was able to circumvent the problem by expanding inner array using jq before the data is written to MongoDB with some code like this (untested):

map(
	({ "data": .data[] })
	+
	with_entries(select(.key != "data"))
)

Don’t know if this the way to go for you though, since this will alter your document structure stored in MongoDB.

but i want to use inner array into virtualize metabase dashboard into new question

Hi rinkesh! Did you solved the problem? I have the same.. I have an attribute (in a MongoDB document) containing the JSON value:

{"_id":"62bef8a57f163500013c2261","message":"ConsoleLogError","priority":0,"params":[{"custom":"Aggiorna e riavvia tab: t0-0"}],"ts":"2022-07-01T13:37:41.82Z","type":"generic","name":"exception","level":"INFO"}

but I'm not able to filter the value contained in the attribute params.

Thanks!

@alberto.manfrinati You have an array with an object inside of it. You would need to create a View on your Mongo. Metabase currently doesn't support unfolding arrays:
https://github.com/metabase/metabase/issues/2974 - upvote by clicking :+1: on the first post

1 Like