سؤال

I have created a simple view in my couchbase database but using Node.js client I cannot get the results. Here is my view:

Production Views:

_design//new
newname

Map:

function(doc, meta) {
  emit(doc.user, doc.score);
}

Node.js code

  var query = bucket.view('_design//new','newview');
  query.query(function(err, results) {
      console.log(results);
      for(i in results){
        console.log(results[i]);
          }
     });
هل كانت مفيدة؟

المحلول 2

It seems that url should be '_design/new/_view/newview' but not '_design/new/newview'

نصائح أخرى

Without looking at the code in detail (I've not used node.js and relevant sdk for couchbase) it seems that your view name is incorrect. You have 'newname' and then in your code you have 'newview'.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top