Class: BSONKeyValueOutput

Inherits:
BSONOutput show all
Defined in:
lib/mongo-hadoop/output.rb

Instance Method Summary collapse

Methods inherited from BSONOutput

#initialize

Constructor Details

This class inherits a constructor from BSONOutput

Instance Method Details

#write(pair) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/mongo-hadoop/output.rb', line 14

def write(pair)
  key, value = *pair

  doc = value.is_a?(Hash) ? value : { :value => value }

  doc['_id'] = key
  super(doc)
end