Class: Oplogjam::Operators::IntermediateField

Inherits:
Intermediate
  • Object
show all
Defined in:
lib/oplogjam/operators/intermediate_field.rb

Instance Attribute Summary

Attributes inherited from Intermediate

#path, #tree

Instance Method Summary collapse

Methods inherited from Intermediate

#initialize, #nodes, #populate, #populate_field, #populate_index, #set, #set_field, #set_index

Constructor Details

This class inherits a constructor from Oplogjam::Operators::Intermediate

Instance Method Details

#update(column) ⇒ Object



6
7
8
9
10
# File 'lib/oplogjam/operators/intermediate_field.rb', line 6

def update(column)
  populated_column = column.set(path, Sequel.function(:coalesce, column[path], EMPTY_OBJECT))

  nodes.inject(populated_column, &UPDATE_COLUMN)
end