Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-241

bucket.query returns all docs when specifying the key

    XMLWordPrintable

Details

    • Task
    • Resolution: Won't Fix
    • Major
    • None
    • 2.0.10
    • None
    • Security Level: Public
    • None
    • Mac OS X 10.10.4

    Description

      Take the following snippet:

      MyDBClass.prototype.findDocumentsWithQuery = function(design_name, view_name, params, cb) {

      var ViewQuery = couchbase.ViewQuery;
      var query = ViewQuery.from(design_name, view_name);

      bucket.query(query, params, function (err, results) {
      if (err)

      { console.log('findDocumentsWithQuery err: ' + err); }

      else

      { console.log('findDocumentsWithQuery results: ' + JSON.stringify(results)); }

      return cb(err, results);
      });

      };

      The view is 'dev_test/test':

      function (doc, meta)

      { emit(meta.id, null); }

      The bucket contains two documents: 'joe' and 'mat'. Issuing the following call returns both:

      myDBClass.findDocumentsWithQuery('dev_test', 'test',

      { key: 'mat' }

      , function (err, results)

      { console.log('main results: ' + JSON.stringify(results, null, 4)); }

      );

      Even if I specify key: 'footer' or even foo: bar will work!

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            brett19 Brett Lawson
            tito Tito Ciuro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty