问题
Is there a way to send hex of binary value instead of base64 to BinData() in mongo ?
回答1:
HexData(3,"00112233445566778899aabbccddeeff") or UUID("00112233445566778899aabbccddeeff")
both will result: BinData(3,"ABEiM0RVZneImaq7zN3u/w==")
And the other way around:
BinData(3,"ABEiM0RVZneImaq7zN3u/w==").hex()
will result: 00112233445566778899aabbccddeeff
回答2:
Only Use HexData(subtype, hexstr)
来源:https://stackoverflow.com/questions/28945535/hex-instead-of-base64-in-bindata-mongodb