hex instead of base64 in BinData() - MongoDB

社会主义新天地 提交于 2020-01-04 04:48:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!