Create a new Binary instance.
This constructor can accept a string as its first argument. In this case,
this string will be encoded using ISO-8859-1, not using UTF-8.
This is almost certainly not what you want. Use new Binary(Buffer.from(string))
instead to convert the string to a Buffer using UTF-8 first.
可选buffer: string | BinarySequencea buffer object containing the binary data.
可选subType: numberthe option binary type.
静态 只读BUFFER_Initial buffer default size
静态 只读SUBTYPE_Byte Array BSON type
静态 只读SUBTYPE_Column BSON type
静态 只读SUBTYPE_Default BSON type
静态 只读SUBTYPE_Encrypted BSON type
静态 只读SUBTYPE_Function BSON type
静态 只读SUBTYPE_MD5 BSON type
静态 只读SUBTYPE_User BSON type
静态 只读SUBTYPE_UUID BSON type
静态 只读SUBTYPE_Deprecated UUID BSON type
the length of the binary sequence
Updates this binary with byte_value.
a single byte we wish to write.
Reads length bytes starting at position.
read from the given position in the Binary.
the number of bytes to read.
Returns a string representation of an object.
可选encoding: "utf8" | "utf-8" | "base64" | "hex"Returns the value of this binary as a string.
可选asRaw: booleanWill skip converting to a string
Writes a buffer or string to the binary.
a string or buffer to be written to the Binary BSON object.
specify the binary of where to write the content.
静态create静态create
A class representation of the BSON Binary type.