Q: Mongodb and Android link using php I currently handle MongoDB with PHP.
I am trying to process data on Android using that value.
PHP:
public function Find($collection, $query = null, $fields = null) {
    /* init */
    $this->mClient = new MongoClient(...);
    $this->mDBName = $dbName;
    $this->mDB = $this->mClient->{$this->mDBName};

    if(!isset($this->mDB)) {
        // TODO
        return;
    }

    /* find query */
    $coll = $this->mDB->{$collection};

    if(isset($query)) {
        if(isset($fields)) $cursor = $coll->find($query, $fields);
        else $cursor = $coll->find($query);
    } else {
        $cursor = $coll->find();
    }

    return json_encode(iterator_to_array($cursor, false));
}

ANDROID:
// Get String From PHP
// ex) [{"_id":{"$id":"59ad4d2425b572b7124be684"},"name":"\uacf5\ud3ec"},{"_id":{"$id":"59ad4d3625b572b7124be69a"},"name":"SF"}]
String result = getHttpData(getInstance().mStrUrl, data);

// In this part, data processing is done
List<DBObject> arr = new ArrayList<DBObject>();
//JSONObject json = new JSONObject(result);
JSONArray jsonArray = new JSONArray(result);
int len = jsonArray.length();
for (int i=0;i<len;i++){
    String json = jsonArray.get(i).toString();
    //Object o = com.mongodb.util.JSON.parse(result);
    Object o = com.mongodb.util.JSON.parse(json);
    DBObject dbObj = (DBObject) o;
    arr.add(dbObj);
}

In the above case, referring to "_ id" will return BasicDBObject. It is necessary to receive an ObjectID.
Likewise for child document "_id" should be ObjectID.
HOW?
