Class: Mongo::Operation::ObjectIdGenerator Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The default generator of ids for documents.

Since:

  • 2.2.0

Instance Method Summary collapse

Instance Method Details

#generateBSON::ObjectId

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Generate a new id.

Examples:

Generate the id.

object_id_generator.generate

Returns:

  • (BSON::ObjectId)

    The new id.

Since:

  • 2.2.0



35
36
37
# File 'lib/mongo/operation/shared/object_id_generator.rb', line 35

def generate
  BSON::ObjectId.new
end