Are `Copy` and `Move` unsuported?
Closed this issue · 2 comments
Hey, great work with diffson, as I understand Copy
and Move
are currently in the code but unused, is that correct?
I was wondering if that is (ever) intended to change? As a consumer I am currently not able to handle copy or move operations, but if they would come in through a new version it could silently break my application at runtime (maybe I could protect it with some test that should produce Copy or Move).
Hi,
the current diff algorithm included in diffson doesn't produce Move
, Copy
, or Test
operations. However they are fully supported and implemented, as described in the RFC, if you use diffson to apply existing patches you get from somewhere else. I have no intent to change the kind of operations generated by the current diff algorithm.
From what you describe, I understand your customer doesn't use diffson to apply the patches, right? Any specific reason why it couldn't work with these operations? A safer approach would be to support all the standard operations.
Thanks for the fast reply.
I am implementing something, that takes two BsonValues
and from the diff generates Updates that than can be applied to MongoDB.
So I provide a Jsony[BsonValue]
and than work with the List[Operation[BsonValue]]
and parse them to MongoDB updates.
I could add support for Move
, Copy
and Test
, but it actually would need quite some logic and would never be used than :)