My goal:
Query documents in MongoDB by _id when _id is stored as a UUID v7 (BinData subtype 04) using Retool.
Issue:
When querying MongoDB through Retool using a UUID v7 value, the query fails with a UUID parsing error.
The same approach works correctly for UUID v4 values.
- UUID v4 works:
{ "_id": { "$uuid": "77746c49-51e7-4c9e-8791-d2b58f8976a4" } }
- UUID v7 fails:
{ "_id": { "$uuid": "019b27d0-7651-74be-acdf-e67656120a3a" } }
Using the UUID as a plain string also does not return any documents:
{ "_id": "019b27d0-7651-74be-acdf-e67656120a3a" }
However, MongoDB Compass shows the document correctly as:
_id: UUID("019b27d0-7651-74be-acdf-e67656120a3a")
Retool version & hosting setup:
- Deployment: Self-hosted Retool
- Database: MongoDB
- _id storage type: UUID (Binary subtype 04)
- UUID version: v7
Error message(s) or screenshots:
Error returned by Retool Mongo query:
Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string
UUID validation check inside Retool:
uuid.validate("019b27d0-7651-74be-acdf-e67656120a3a") // returns false
UUID length and hex format are correct:
- length: 36
- hex-only characters: true
What Iβve tried so far:
- Querying with
$uuid(works for UUID v4, fails for UUID v7) - Querying with
_idas a plain string - Verifying the UUID format and length
- Confirming the document exists and is queryable via MongoDB Compass
Question:
Is querying MongoDB documents by UUID v7 (BinData subtype 04) supported in Retool?
If not, is there an official workaround or recommended approach (e.g. using $binary, automatic conversion, or avoiding UUID v7 for _id)?
Any guidance would be appreciated β thanks!