Mongo UUIDs not represented

Hi there!

I have been using Metabase for some years already with Postgres, and now I have a product in which we have the information in MongoDB.

I have verified that using an ObjectId is well represented, but it is not the case for UUIDs. Here is an example of how they look like:

image

Mongo offers a specific BSON Type for UUID as binary data, you can see them here.

In specific, they store the UUID as a subtype 4.

If I inspect the data, it looks like this:

{
  "_id": {
    "$binary": {
      "base64": "ZD+zq5sNTRSnfvfz1/n1HA==",
      "subType": "04"
    }
  }
}

It looks like Metabase isn't parsing the Mongo binary BSON types properly.

Has anyone been able to parse correctly UUID for IDs in Mongo? It is preventing us to use Metabase build dashboards as filtering by ID using a UUID format isn't possible.

Happy to help to implement a PR if this isn't implemented with some pointers to how to do it :smile:

I don't know that I fully understand what you mean when you says it's not parsing correctly. Can you elaborate on what exactly you're trying to do in the product? Do either of the below feel related to your situation?

We do have some issues with remapping and UUIDs:

And filtering on UUIDs:

We love it when folks are interested in contributing to the product! For more information on that check out this page in the developers guide:

Sure, what I meant is that the ID is represented as org.bson.types.Binary@<something> instead of 5ebf0f3c-042e-4cff-acc5-9483532c6afe.

A UUID type using Postgres is displayed correctly as:

image

Here is an example of Mongo using an UUID (first row) and an ObjectId (second row)

image

It looks like the mongo driver is missing the parsing or formatting for the UUID type.