I have a sample JSON body that contains some strings. I want some of the strings to be converted into Mongo Extended JSON. For example, the JSON body passed in is the following:
{
"GuidBinary": "734cba69-4851-4869-8d0e-e870d6fb3065",
"DateTime": "12/12/2012",
"RegularString": "abcd"
}
And I want to convert this into
{
"GuidBinary": {
"$binary": {
"base64": "<payload>",
"subType": 0x03
}
},
"DateTime": {"$date": "<ISO-8601 Date/Time Format>"},
"RegularString": "abcd"
}
Is there a way to do this in Go, either through a package like mongo-go-driver or another method?