Method: BSON::DBRef#to_bson

Defined in:
lib/bson/dbref.rb

#to_bson(buffer = ByteBuffer.new) ⇒ BSON::ByteBuffer

Converts the DBRef to raw BSON.

Examples:

Convert the DBRef to raw BSON.

dbref.to_bson

Parameters:

  • buffer (BSON::ByteBuffer) (defaults to: ByteBuffer.new)

    The encoded BSON buffer to append to.

Returns:



129
130
131
# File 'lib/bson/dbref.rb', line 129

def to_bson(buffer = ByteBuffer.new)
  as_json.to_bson(buffer)
end