HexData()
定義
Creates a binary data object from hexadecimal data.
構文
HexData()
の構文は次のとおりです。
コマンドフィールド
このコマンドは、次のフィールドを取ります。
フィールド | タイプ | 必要性 | 説明 | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| integer | 必須 | Specify a data subtype:
| ||||||||||||||||||||||||
| string | 必須 | Hexadecimal data. The string is decoded up to the first character that is not a valid hexadecimal digit. You can use upper or lower case letters in the hexadecimal string. |
例
1
2
Retrieve the document
To return the document, run the following find
command:
db.hexCollection.find()
Output shows the hexField
value as a base 64 number using
Binary.createFromBase64()
:
[ { _id: 0, hexField: Binary.createFromBase64('EjRWq83v', 0) } ]