Module: Mongo::Operation::Write::Idable
- Included in:
- Bulk::Insert, Insert
- Defined in:
- lib/mongo/operation/write/idable.rb
Overview
This module provides functionality to ensure that documents contain an id field. Used by insert operations (Bulk, legacy, write command inserts).
Constant Summary collapse
- ID_GENERATOR =
The option for a custom id generator.
:id_generator.freeze
Instance Method Summary collapse
-
#id_generator ⇒ IdGenerator
Get the id generator.
Instance Method Details
#id_generator ⇒ IdGenerator
Get the id generator.
38 39 40 |
# File 'lib/mongo/operation/write/idable.rb', line 38 def id_generator @id_generator ||= (spec[ID_GENERATOR] || ObjectIdGenerator.new) end |