I would like to create a view with map / reduce functions that return the latest values from several documents with same id, seems I can return the latest document giving with the xyz id based on the update_datetime, not sure how to get the latest value like field1 and field2, thank you
doc1: id='xyz', field1='v1.0', field2='v2.0', field3='v3.0', status='NEW', update_datetime='2015-04-28'
doc2: id='xyz', field2='v2.1', field3='v3.0', status='CHANGED', update_datetime='2015-05-01'
doc3: id='xyz', field3='v3.1', status='CLOSED', update_datetime='2015-05-10'
define a view with map / reduce that, given a key value 'xyz', returns the following document:
id='xyz', field1='v1.0', field2='v2.1', field3='v3.1', status='CLOSED', update_datetime='2015-05-10'.