On couchDB I have the following view:
function(doc) { if(doc._id === 'countryMobileNumberCodes') { Object.keys(doc.dictionary).forEach(function(k, i) { emit(k, doc.dictionary[k]); }); } } This emits the following result:
{"total_rows":2,"offset":0,"rows":[ {"id":"countryMobileNumberCodes","key":"1","value":"+265"}, {"id":"countryMobileNumberCodes","key":"2","value":"+27"} ]} This same view on Android (using couchbase-lite-android 1.2.1) does not emit any rows. However, if I were to change the view to this:
function(doc) { if(doc._id === 'countryMobileNumberCodes') { emit(doc._id, doc.dictionary); } } Then I do get results from couchbase-lite (so the docs definitely exist on the mobile device).
Does CouchDB implement MapReduce differently to couchbase-lite?
I have seen reference to the fact that couchbase-lite and CouchDB are 100% compatible, but that does not seem to be the case (Couchbase-lite and CouchDB).