Is there any way to create a Segment with a Native query? I need to segment on data within an array from MongoDB.
data.SegmentData === “somedata”
Any pointers or help greatly appreciated,
Thanks in advance
I’m not sure what you’re asking, since I don’t know MongoDB, but is this specific to Metabase or a general MongoDB question?
Currently it’s not possible to use Native/SQL queries as segment/metric:
https://github.com/metabase/metabase/issues/5194 - upvote by clicking on the first post
For general MongoDB question, then you’ll probably find better help in one of their communities:
Thanks @flamber. Apologies for the confusion, this was a Metabase question, not MongoDB.
I’ve upvoted the Issue, this is the feature I’m looking for.
Are there any workarounds for this? I tried quickly hacking the Segment table in the DB to include a native query, but it didn’t work.
I would highly recommend not messing around in the metadata manually - make sure you have backups, since you can easily corrupt it.
I’m not sure what you’re trying to do, but with other databases you can get around a lot of things with
Procedures - I don’t know Mongo.
You might also be interested in this issue:
https://github.com/metabase/metabase/issues/10327 - upvote by clicking on the first post
Thanks, yes, everything is backed up and safe. It was worth the quick experiment.
I’ll keep an eye on the mentioned issues and continue with my other workaround.