I'm a little stuck with the following problem.
From a MongoDB I get this JSON string, and I want to get all the valuas of 'photo' and put them in an ArrayList. I've found some examples but they aren't working for me. I'm using GSON but a JSON solution will also be fine.
Return from MongoDB:
[ { "url" : "/photos/avatar-1.jpg" , "photo" : "avatar-1.jpg" , "description" : "test 1"} , { "url" : "/photos/avatar-2.jpg" , "photo" : "avatar-2.jpg" , "description" : "test 2"} , { "url" : "/photos/avatar-3.jpg" , "photo" : "avatar-3.jpg" , "description" : "test 3"} , { "url" : "/photos/avatar-4.jpg" , "photo" : "avatar-4.jpg" , "description" : "test 4"}]
Putting into an ArrayList isn't the problem, but getting the 'photo' value. If someone could give me an example on how to loop through the 4 arrays and a System.out.println of the 'photo' value, that would be great!!
Thanks!