HexData()
Definição
Creates a binary data object from hexadecimal data.
Sintaxe
HexData()
tem a seguinte sintaxe:
Campos de comando
O comando usa esses campos:
Campo | Tipo | necessidade | Descrição | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| inteiro | Obrigatório | Specify a data subtype:
| ||||||||||||||||||||||||
| string | Obrigatório | 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. |
Exemplos
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) } ]