class BSON::Regexp::Raw

def to_bson(buffer = ByteBuffer.new)

Other tags:
    See: http://bsonspec.org/#/specification -

Returns:
  • (BSON::ByteBuffer) - The buffer with the encoded object.

Parameters:
  • buffer (BSON::ByteBuffer) -- The byte buffer to append to.

Other tags:
    Note: - From the BSON spec: The first cstring is the regex pattern,

Other tags:
    Example: Get the raw regular expression as encoded BSON. -
def to_bson(buffer = ByteBuffer.new)
  buffer.put_cstring(source)
  buffer.put_cstring(options.chars.sort.join)
end