I have a map called myData. It has 2 keys: :user_id and :name. I want to search it by the 2 keys.
{{:user-id 1, :name "abc"} [{:user-id 1, :name "abc", :uri "/"}],
{:user-id 2, :name "bcd"} [{:user-id 2, :name "bcd", :uri "/foo"}],
{:user-id 1, :name "cde"} [{:user-id 1, :name "cde", :uri "/account"}]}
I have tried: (get-in mydata [:user-id 1 :name "abc"]) and (get-in mydata [1 "abc"]). Neither of them works. What's the correct way to retrieve the data?
You have a map with keys that are maps that look like
{:user-id 1, :name "abc"}, so in order to get the values associated with those keys you should pass a map that looks like that intoget.