androidcouchbasetouchdbcouchbase-lite

CBLite Android - Get values in second level


Using CBLite Android, and storing docs (similar to Android Grocery Sync example) like this:

{
     "check" : true,
     "created_at" : "2014-02-25T10:16:46.026Z",
     "text" : "Soap",
     "prices":[  { "date" : "2014-02-25" , "value" : 12 }  ]
}

I get value in "text" field ​​as shown in the documentation:

...
Document document = row.getDocument();
String text = ((String)document.getCurrentRevision().getProperty("text"));
...

But, How should I do to get the value in, for example, "value" field?

Thanks.


Edit:
Getting documents
API reference


Solution

  • Search in the doc to something which allow you to get an array, then read the array to get value.