ExportXMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.53.2
    • Component/s: None
    • None
    • Environment:
      OS: macos 27
      MongoDB Compass: Version 1.53.2 (1.53.2)
      MongoDB: docker image mongo:9.0-noble

    • None
    • None
    • Developer Tools

      MongoDB Compass Filter does not accept HexData() for BSON Binary subtype 0

      Description

      MongoDB Compass does not accept the HexData() BSON constructor in the Documents → Filter query bar, although the same filter works correctly in mongosh.

      This makes querying 16-byte binary identifiers, such as UUIDv7 values stored using BSON Binary subtype 0x00, unnecessarily difficult.

      Steps to reproduce

      1. Create a test document using mongosh:

      {{db.hexdata_compass_repro.insertOne({

      _id: 1,
      uuid: HexData(0, "019e79c7cb9177559c7fc87b53043211")
      });}}

      1. Verify that the query works in mongosh:

      {{db.hexdata_compass_repro.find({

      uuid: HexData(0, "019e79c7cb9177559c7fc87b53043211")
      });}}

      1. Open the hexdata_compass_repro collection in MongoDB Compass.
      1. Enter the following expression into the Documents → Filter field:

      { uuid: HexData(0, "019e79c7cb9177559c7fc87b53043211") }

      Actual behavior

      The Compass Filter field does not accept the HexData() expression, while the equivalent mongosh query works.

      Expected behavior

      Compass should recognize HexData(subtype, hexString) and convert it into the corresponding BSON Binary value, consistently with mongosh.

      The query should return the inserted document.

      Workaround

      Manually convert the hexadecimal UUID into Base64 and query using:

      { uuid: BinData(0, "AZ55x8uRd1Wcf8h7UwQyEQ==") }

      However, this requires an unnecessary conversion for every identifier.

      Environment

      • MongoDB Compass: Version 1.53.2 (1.53.2)
      • MongoDB Server: mongo:9.0-noble
      • Operating system: macos 27
      • BSON data type: Binary, subtype 0x00
      • Identifier format: UUIDv7 (16 bytes)

      References

      Suggested improvement

      Support HexData() in the Compass Filter query parser, consistently with the mongosh representation of BSON Binary values.

            Assignee:
            Unassigned
            Reporter:
            Alex Pts (EXT)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: