0

i get child document mongodb

android retriving data and read them

NodeJS+MongoDB

 [ { pinNumber: '4',
   nameDevice: 'den ngu',
   pintype: 0,
   deleted: '0',
   status: '0',
   laston: '31 thg 5, 2017 10:53:02' },
 { pinNumber: '9',
   nameDevice: 'quat ngu',
   pintype: 0,
   deleted: '0',
   status: '0',
   laston: '31 thg 5, 2017 10:54:14' },
 { pinNumber: '4',
   nameDevice: 'den',
   pintype: 0,
   deleted: '0',
   status: '0',
   space_id: '592cf576a53411474242b5fa',
   laston: '31 thg 5, 2017 11:45:31' } ] }

i can't parse them, help me!

1 Answers1

0

Assuming you want to parse this json in java you can look at this : How to parse JSON in Java

import org.json.*;

JSONObject data = new JSONObject("you json here");

for(int i=0 ;i < data.length() ; i++){

String pinNumber = data.getJSONObject(i).getString("pinNumber");

}

Downloadable jar: http://mvnrepository.com/artifact/org.json/json

You seem to have a extra '}' in the end in your json.

Community
  • 1
  • 1