I have data like so:
[Equipment] [DateTimeIn]
T-0001B 2017-05-05T00:00:00:00.000
T-0001B 2017-06-05T15:00:00:00.000
T-0503A 2017-03-05T13:00:00:00.000
And am trying to get an output like this:
T-0001B 2017-06-05T15:00:00:00.000
T-0503A 2017-03-05T13:00:00:00.000
The "table" is a list of transfers for all equipment with a datefield of when the transfer took place.
I'm new to CouchDB/PouchDB, having been in SQL land for 15 or so years. I've searched this and run across quite a few examples of how to group by fields (keys or partial keys), and how to summerize them. Because there does not seem to be any "Reduce: __max" method, how would I go about getting the "latest row" for each equipment as in the above example? My real data consists of about 5000 docs with 1000 unique equipment ids.
I could see this being used in apps to show "latest comment on each thread" or "last reply on XXXXX" per thread (for forum style apps). In my case I'm interested in the latest row for each equipment so I can then query JUST those rows to further filter them to determine how many are on a particular job, or how many are still in transit..etc (other fields).
Any ideas?