Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add UUID helper functions for MongoDB BSON Binary #564

Open
wants to merge 3 commits into
base: 4.x
Choose a base branch
from

Conversation

AngusDV
Copy link

@AngusDV AngusDV commented Aug 11, 2024

This commit adds the following helper functions:

  1. mongodb_uuid($value): Converts a UUID string to a MongoDB BSON Binary object.
  2. mongodb_uuid_to_string($uuid): Converts a MongoDB BSON Binary object representing a UUID to a string.
  3. mongodb_uuid_generate(): Generates a new UUID and returns it as a MongoDB BSON Binary object.

These functions simplify the process of working with UUID data in a MongoDB database using the Ramsey/Uuid and MongoDB/BSON libraries.

This commit adds the following helper functions:

1. `mongodb_uuid($value)`: Converts a UUID string to a MongoDB BSON Binary object.
2. `mongodb_uuid_to_string($uuid)`: Converts a MongoDB BSON Binary object representing a UUID to a string.
3. `mongodb_uuid_generate()`: Generates a new UUID and returns it as a MongoDB BSON Binary object.

These functions simplify the process of working with UUID data in a MongoDB database using the Ramsey/Uuid and MongoDB/BSON libraries.
@AngusDV AngusDV requested a review from ramsey as a code owner August 11, 2024 07:06
@ramsey
Copy link
Owner

ramsey commented Aug 20, 2024

Thanks for contributing these functions. Since they’re specific to MongoDB, I think it’d be better to create a separate package for them. What do you think?

@AngusDV
Copy link
Author

AngusDV commented Aug 21, 2024 via email

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