Module: Mongo::BulkWrite::Transformable Private
- Included in:
- OrderedCombiner, UnorderedCombiner
- Defined in:
- build/ruby-driver-v2.19/lib/mongo/bulk_write/transformable.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Defines behavior around transformations.
Constant Summary collapse
- DELETE_MANY =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The delete many model constant.
:delete_many.freeze
- DELETE_ONE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The delete one model constant.
:delete_one.freeze
- INSERT_ONE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The insert one model constant.
:insert_one.freeze
- REPLACE_ONE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The replace one model constant.
:replace_one.freeze
- UPDATE_MANY =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The update many model constant.
:update_many.freeze
- UPDATE_ONE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The update one model constant.
:update_one.freeze
- DELETE_MANY_TRANSFORM =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Proc to transform delete many ops.
->(doc){ { Operation::Q => doc[:filter], Operation::LIMIT => 0, }.tap do |d| d[Operation::COLLATION] = doc[:collation] if doc[:collation] d['hint'] = doc[:hint] if doc[:hint] end }
- DELETE_ONE_TRANSFORM =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Proc to transform delete one ops.
->(doc){ { Operation::Q => doc[:filter], Operation::LIMIT => 1, }.tap do |d| d[Operation::COLLATION] = doc[:collation] if doc[:collation] d['hint'] = doc[:hint] if doc[:hint] end }
- INSERT_ONE_TRANSFORM =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Proc to transform insert one ops.
->(doc){ doc }
- REPLACE_ONE_TRANSFORM =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Proc to transfor replace one ops.
->(doc){ { Operation::Q => doc[:filter], Operation::U => doc[:replacement], }.tap do |d| d['upsert'] = true if doc[:upsert] d[Operation::COLLATION] = doc[:collation] if doc[:collation] d['hint'] = doc[:hint] if doc[:hint] end }
- UPDATE_MANY_TRANSFORM =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Proc to transform update many ops.
->(doc){ { Operation::Q => doc[:filter], Operation::U => doc[:update], Operation::MULTI => true, }.tap do |d| d['upsert'] = true if doc[:upsert] d[Operation::COLLATION] = doc[:collation] if doc[:collation] d[Operation::ARRAY_FILTERS] = doc[:array_filters] if doc[:array_filters] d['hint'] = doc[:hint] if doc[:hint] end }
- UPDATE_ONE_TRANSFORM =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Proc to transform update one ops.
->(doc){ { Operation::Q => doc[:filter], Operation::U => doc[:update], }.tap do |d| d['upsert'] = true if doc[:upsert] d[Operation::COLLATION] = doc[:collation] if doc[:collation] d[Operation::ARRAY_FILTERS] = doc[:array_filters] if doc[:array_filters] d['hint'] = doc[:hint] if doc[:hint] end }
- MAPPERS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Document mappers from the bulk api input into proper commands.
{ DELETE_MANY => DELETE_MANY_TRANSFORM, DELETE_ONE => DELETE_ONE_TRANSFORM, INSERT_ONE => INSERT_ONE_TRANSFORM, REPLACE_ONE => REPLACE_ONE_TRANSFORM, UPDATE_MANY => UPDATE_MANY_TRANSFORM, UPDATE_ONE => UPDATE_ONE_TRANSFORM }.freeze