Parent

Methods

BSON::DBRef

A reference to another object in a MongoDB database.

Attributes

namespace[R]
object_id[R]

Public Class Methods

new(namespace, object_id) click to toggle source

Create a DBRef. Use this class in conjunction with DB#dereference.

@param [String] a collection name @param [ObjectId] an object id

@core dbrefs constructor_details

# File lib/bson/types/dbref.rb, line 28
def initialize(namespace, object_id)
  @namespace = namespace
  @object_id = object_id
end

Public Instance Methods

to_hash() click to toggle source
# File lib/bson/types/dbref.rb, line 37
def to_hash
  {"$ns" => @namespace, "$id" => @object_id }
end
to_s() click to toggle source
# File lib/bson/types/dbref.rb, line 33
def to_s
  "ns: #{namespace}, id: #{object_id}"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.