I have a JSON key which I loaded into Redis by means of
redis-cli -x JSON.SET MyKey $ < DataFile.json
Later on, and using the same mechanism I loaded another JSON data file as a key named NewKey.
This new JSON data file is structured the same as the original one, with some of the fields in the new JSON data file having different values.
What I would like is for MyKey to end up pointing to the JSON data that has been uploaded as NewKey. That is, when at the Redis CLI I do
JSON.GET MyKey $
JSON.GET NewKey $
I get different things, for the data used to set MyKey was different from the data used to set NewKey. What I am asking is whether there is a Redis/JSON command such that, after it has been issued, the two JSON.GET commands above will print out exactly the same data, with the data originally assigned to MyKey presumably being lost in the process.
Can this be done? One can obviously modify individual fields in MyKey with new values, as obtained from NewKey, but I wonder whether Redis/JSON provides a more powerful approach to do what I am asking.