Skip to content

INTPYTHON-974 Add support for MD5/SHA256 database functions#546

Merged
timgraham merged 1 commit into
mongodb:mainfrom
timgraham:hash-funcs
May 29, 2026
Merged

INTPYTHON-974 Add support for MD5/SHA256 database functions#546
timgraham merged 1 commit into
mongodb:mainfrom
timgraham:hash-funcs

Conversation

@timgraham
Copy link
Copy Markdown
Collaborator

No description provided.

@aclark4life
Copy link
Copy Markdown
Collaborator

What's going on in the test, a DTModel instance gets an encrypted annotation right? Could a field of DTModel hold an encrypted value?

@timgraham
Copy link
Copy Markdown
Collaborator Author

The functions compute a given value's hash. It's unrelated to queryable encryption and encrypted fields.

The tests are a bit bogus since the input of $hash "Must resolve to a valid UTF-8 string or BinData" (and here we have a datetime) but it's good enough to trigger the error being tested. SInce these tests are temporary until older versions of MongoDB are EOL, I didn't see any point in adding another model for these tests in the meantime. Django's test suite has tests with proper inputs.

@timgraham timgraham merged commit 8692ea5 into mongodb:main May 29, 2026
21 checks passed
@timgraham timgraham deleted the hash-funcs branch May 29, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants