Say I have a list of names with ids, in JSON:
(let ((json-object-type 'plist))
(setq mylist (json-read-from-string "[{\"name\": \"Adam\", \"id\": \"1\"},
{\"name\": \"Eve\", \"id\": \"2\"}]")))
I want to find out Adam's id. How do I do that?
I'm currently trying
(dolist (person mylist)
(when (equal "Adam" (plist-get person :name))
(setq person_id (plist-get person :id)))
)
But this raises setq: Wrong type argument: listp, [(:id "1" :name "Adam") (:id "2" :name "Eve")]
(append vector nil)
.