Accessing UUID as string in function

Hi,

I’ve looked at various guides and previous posts and am getting nowhere so I’m going to ask here for some advice :slight_smile:

I have a Mongo Atlas Trigger invoked during an insert in which I’m sending an http request (I suspect there are feelings putting this within a trigger but its required presently) with elements from the full document passed through.

My data is stored in the following format:

image

How can I convert the binary value of my string into a human readable UUID which I can then use.

Thanks

@Chris_Boot1 Have you checked this built-in BSON module method? then parse the string to UUID object.

1 Like

Amazing thank you @Phoebe_Lam, this is exactly what I was looking for, the toHex() function converted my binary to a string without the dashes which gets me much closer to my ultimate goal!

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.