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. 此构造函数可以接受字符串作为其第一个参数。在这种情况下,这个字符串将使用ISO-8859-1编码,而不是使用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.new Binary(Buffer.from(string))
将字符串转换为使用UTF-8的缓冲区。
a buffer object containing the binary data.包含二进制数据的缓冲区对象。
the option binary type.选项二进制类型。
Initial buffer default size初始缓冲区默认大小
Byte Array BSON type字节数组BSON类型
Column BSON type列BSON类型
Default BSON type默认BSON类型
Encrypted BSON type加密BSON类型
Function BSON type功能BSON类型
MD5 BSON typeMD5 BSON型
User BSON type用户BSON类型
UUID BSON typeUUID BSON类型
Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID不推荐的UUID BSON类型@不推荐的请使用SUBTYPE_UUID
the length of the binary sequence二进制序列的长度
Updates this binary with byte_value.用byte_value更新此二进制文件。
a single byte we wish to write.我们希望写入的单个字节。
Reads length bytes starting at position.读取从position
开始的length
字节。
read from the given position in the Binary.从二进制文件中的给定位置读取。
the number of bytes to read.要读取的字节数。
Returns the value of this binary as a string.以字符串形式返回此二进制文件的值。
Will 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.要写入Binary BSON对象的字符串或缓冲区。
specify the binary of where to write the content.指定内容写入位置的二进制值。
Generated using TypeDoc
A class representation of the BSON Binary type.BSON二进制类型的类表示。