Reputation: 13153
I have map like this:
data = {user.name: "John",
user.surname: "Doe",
city: "NY"}
I can access attiribute 'city' this way:
data.city
Is there is a similar way to access 'user.name' attribute?
Upvotes: 6
Views: 5918
Reputation: 171054
Assuming you meant:
data = [ 'user.name':"John", 'user.surname':"Doe", city:"NY" ]
(square braces for the map definition, and quotes round the dotted key names), I believe that
data.'user.name'
should do it
Upvotes: 16