mongoid-history
mongoid-history copied to clipboard
Value of field at time t
Is there a convenient way for retrieving (by reading the history ?), the value of a given field at time t ?
I would like to be able to compute some statistics, and for that I need the specific value a field had in the past (assuming it was tracked correctly). Some sort of "git like checkout" but only for a specific field, and I don't care if it takes a lot of time to compute for now (I'm gonna do this in an asynchronous job, quite seldom)
There isn't, but it would be very useful, please feel free to PR! I suspect you'd have to find any change in history that affected a field up to time T and undo it. It looks like an interesting problem.
I would maybe start by implementing getting an entire document at version X/time t.