if this does not work, I think this may be due to the fact that the value isn;t encoded correctly in Couchbase Server. Can you go under “Data Buckets” in the admin tool and click on “Documents” button next to bucket “Elsa” > type in the document ID and ensure Couchbase has received the JSON and can display it correctly?
The attributes are in double quotes.I only forgot to put them into double quotes when writing this blog. I can see the correct JSON structure in the Couchbase Admin console, if I go to the primary view and select show.
Even, if I do SELECT * from elsa I get an empty result set.
If I go to the data buckets tab, I can see that there are 30 documents in the bucket. If I select the documents button next to the bucket then the console starts loading but does not finish loading. After a timeout I have to close the window.
I also created the following view now:
function (doc, meta) {
if (doc.wi_rl.lang)
emit(meta.id, doc.wi_rl.lang);
}
With that view I get a result set of 30 documents in the admin console.
I created the primary index from cbq with CREATE PRIMARY INDEX on elsa. The same I did already before importing the documents on the empty bucket. But obviously there seemed to be a problem with the primary index after importing the documents. Now when I recreated the primary index I can also see the list of documents in the data buckets tab of the admin console although it takes quite a long time until the list is generated.
I found another problem concerning attributes containing a dash in the attribute name. If I submit for example SELECT wi_rl[“dok-id”] FROM elsa I get a result set with 30 null values although every document has a dok-id.