uuid icon indicating copy to clipboard operation
uuid copied to clipboard

feat: add UUID helper functions for MongoDB BSON Binary

Open AngusDV opened this issue 1 year ago • 2 comments

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 avatar Aug 11 '24 07:08 AngusDV

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?

ramsey avatar Aug 20 '24 05:08 ramsey

hi you are my boss :D I saw this issue in your repository:

https://github.com/ramsey/uuid/issues/261 https://github.com/ramsey/uuid/issues/63

After that, I decided to improve the code.

On Tue, Aug 20, 2024 at 9:19 AM Ben Ramsey @.***> wrote:

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?

— Reply to this email directly, view it on GitHub https://github.com/ramsey/uuid/pull/564#issuecomment-2298017894, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKMUVYHCA44XVJPSULPFVLZSLKGJAVCNFSM6AAAAABMKQAZO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJYGAYTOOBZGQ . You are receiving this because you authored the thread.Message ID: @.***>

AngusDV avatar Aug 21 '24 11:08 AngusDV

Closing this, since these helper methods that are specific to MongoDB should be in a separate package.

ramsey avatar May 25 '25 16:05 ramsey