Class: Mongo::Operation::ObjectIdGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo/operation/object_id_generator.rb

Overview

The default generator of ids for documents.

Since:

  • 2.2.0

Instance Method Summary collapse

Instance Method Details

#generateBSON::ObjectId

Generate a nwe id.

Examples:

Generate the id.

object_id_generator.generate

Returns:

  • (BSON::ObjectId)

    The new id.

Since:

  • 2.2.0



31
32
33
# File 'lib/mongo/operation/object_id_generator.rb', line 31

def generate
  BSON::ObjectId.new
end