If only seeing new data suits your use case, then you are probably ok with this approach.   You may wish to look at %ValidateIndices() which I believe is present in Cache2018.   This will allow an online check of the index state and can either report on mismatches, or be set to autorepair.  It is MUCH slower than a %BuildIndices, but does not require a full freeze for safety

https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...

Hi Julius

Thanks for your comments, and you are correct in assessing this is for a specific use case (I'm migrating data between 2 structures and want to make sure the exported JSON is EXACTLY the same).

For the first point, I really only care that all values in the source are also in the target.   If I wanted to be thorough, I woudl run the compare in both directions, but since I'm expecting that the target will contain additional properties, I only need a 1 way compare)

For the second point, I actually define the ordering of exporting of arrays explicitly, so I would expect a like for like compare.   For other cases, additional logic would need to be added, as you pointed out

For the last point,  this should return a mismatch, which is good enough for my use case, but again, might not be ideal for other use cases