How to retrive keys and values in nested array and list?



I have document structure in Couchbase like this

“key” : “xxx”,
“list” :
“itemA” : “xxx”,
“itemB” :
{“itemB-1” : “xxx”, “itemB-2” : “xxx”}

    "itemA" : "xxx",
    "itemB" : 
        {"itemB-1" : "xxx", "itemB-2" : "xxx"}


How can I retrive “ItemA” and “itemB-1” level by using Get() or GetJson() or other method?

I saw “NCBC-316: Allow GetJson to support the retrieval of arrays and lists:”(

and tried .NET SDK 1.3.3 but failed.


Hi Cloudy -

The NCBC you linked to solves a different use case: storing lists and arrays of data as JSON; it doesn’t relate to documents with nested JSON arrays.

In order to do this, you would need to create a view. Here are a couple of resources to get you started:


Take a crack at it and let me know if you get stuck!



Hi Jeff

Thx for your reply.

Actually, I already had a view was changed for performance this time.
So I found the way to approach the items in API support .

I made 2 classes,

public class tmpDOC
public String key;

public String itemA;

public List list;


public class tmpList
public String itemB-1;


and I got doc with GetJson() like I thought first.

tmpDoc = client.GetJson(key);

If I need to handle more nested Json doc later,
I think it needs more classes or have to parse/handle the doc in application level.

bye~ :slight_smile:


something wrong in my comment.
I tried to edit my comment but access denied.