Method: Mongoid::Persistence::Atomic::Operation#operation

Defined in:
lib/mongoid/persistence/atomic/operation.rb

#operation(modifier) ⇒ Hash

Get the atomic operation to perform.

Examples:

Get the operation.

inc.operation

Parameters:

  • modifier (String)

    The modifier to use.

Returns:

  • (Hash)

    The atomic operation for the field and addition.

Since:

  • 2.0.0



49
50
51
# File 'lib/mongoid/persistence/atomic/operation.rb', line 49

def operation(modifier)
  { modifier => { path => value } }
end