MongoEngine / MongoEngine/mongoengine

Support for binary subtype 0x04 UUIDs

Open
#2,747 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.3k
Forks
1.2k
Avg merge
4h 41m
Merged PRs (30d)
11

Description

Hello,
While searching on the web, I have seen no mention for mongoengine support of current version of mongo UUID fields (binary subtype 0x04).
When I use the following definition it generates a binary subtype 3 ; which MongoDB compass doesn't display efficiently.

class User(mongoengine.Document):
    id = mongoengine.UUIDField(primary_key=True, required=True, default=lambda: str(uuid.uuid4()))

u = User()
u.save()

Do you support "binary subtype 0x04 UUIDs"?
How can we use them?
Is there an easy migration path?

Thanks for your support


Tested with version: 0.27
MongoDB 4.4.14 Community

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with mongoengine.UUIDField and reproduce the shown User definition against MongoDB 4.4.14, checking which binary subtype is stored and how Compass displays it. Done means subtype 0x04 support, usage guidance, and an easy migration path are clearly addressed; no specific source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, python
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.