HI,
I created a couchbase map reduce view, published it to production & tested the view, it returns me 4 rows. The view has only map part as below:
Couchbase View
function(doc) {
if (doc.t == "memGroupsTest") {
if (doc.memGroupMems) {
for (i=0; i < doc.memGroupMems.length; i++) {
if (doc.memGroupMems[i].requestSentTs == 0) {
emit(doc.memId, doc.groupId, doc.groupName, doc.memGroupMems[i].groupMemId, doc.memGroupMems[i].allowTrainNotifications);
}
}
}
}
}
The following is the Python code
from couchbase.views.params import Query
try:
print("In...")
#cb is my bucket object
rows = self.cb.query("_design/dev_myDev", "pending", include_docs=False)
print(str(rows))
for row in rows:
print(str(row.key))
print("Leaving...")
except Exception as e:
print(str(e))
The following message gets printed on console:
<RC=0x3B[HTTP Operation failed. Inspect status code for details], HTTP Request failed. Examine 'objextra' for full result, Results=1, C Source=(src/http.c,144), OBJ=ViewResult<rc=0x3B[HTTP Operation failed. Inspect status code for details], value=None, http_status=400, tracing_context=0, tracing_output=None>, Tracing Output={":nokey:0": null}>
I had also tried the following…still getting zero rows.
from couchbase.views.params import Query
....
....
....
q = Query()
q.limit = 10
rows = self.cb.query("_design/dev_myDev", "pending", include_docs=False, query=q)
The same view is returning data when queried in couchbase, but zero rows when queried in python.
Am I missing something???
Thanks ,
Sachin