I have a condition where, I get a hash
hash = {\"_id\"=>\"4de7140772f8be03da000018\", .....}
and I want this hash as
If we want to rename a specific key in hash then we can do it as follows: Suppose my hash is my_hash = {'test' => 'ruby hash demo'} Now I want to replace 'test' by 'message', then: my_hash['message'] = my_hash.delete('test')
my_hash = {'test' => 'ruby hash demo'}
my_hash['message'] = my_hash.delete('test')