mongoid-history icon indicating copy to clipboard operation
mongoid-history copied to clipboard

Value of field at time t

Open Startouf opened this issue 8 years ago • 1 comments

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)

Startouf avatar Sep 23 '16 09:09 Startouf

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.

dblock avatar Sep 23 '16 11:09 dblock