How can we convert BSON binary with subtype=0x03 to subtype=0x03

You can find in the BSON specification that a binary of subtype 03 (UUID Old) is deprecated and we should use subtype 04 (UUID).

How can we convert a 03 binary to a 04 binary? We can find the method to do that in mongo-python-driver:

According to the above code, we can convert a 03 UUID binary to a 04 UUID binary by reversing the first 8 bytes and the last 8 bytes separately.

Good luck.