Reputation: 3208
Why when I use
['type':x, z:y]
Where
x = 'Car'
z = 'Speed'
y = '1000'
I get a map equal to
[type=Car, z=1000]
and not
[type=Car, Speed=1000]
and how can I overcome it?
Upvotes: 3
Views: 958
Reputation: 187379
If the keys of your Map are always strings, the following approach should also work
['type':x, "$z":y]
Upvotes: 0