Open intellix opened 8 years ago
Shoot! Deserialize should definitely not mutate, that was a bad call on my part (trying to be prematurely efficient :/)
How do we work around this? Is there an easy way to convert this object to a regular Date object? Like, maybe, new Date(o.created.epoch_time)
? Or do you suggest that we don't store Date objects, but instead store timestamps, date.getTime()
?
Maybe copy the object before storing it, and copy the returned id back to the original copy? Hairy...
The same problem occurs with collection.update
.
Server version: 1.1.3 Client version: 1.1.3
I'm using ng2 and piping a date object into a particular format within my view. Upon using store, the date is replaced by Horizon/RethinkDB metadata within the original object so my view dies. I'm currently getting around this by copying the object with:
Object.assign({}, o)
Example: