Skip to content
This repository was archived by the owner on Nov 5, 2018. It is now read-only.

Problem with OR -clauses? #357

Closed
sbatururimi opened this issue Feb 5, 2018 · 1 comment
Closed

Problem with OR -clauses? #357

sbatururimi opened this issue Feb 5, 2018 · 1 comment

Comments

@sbatururimi
Copy link

I tried to use the keys array while querying with a view but always got an empty result. Any help with that?

@sbatururimi
Copy link
Author

I have fixed that by using:

alice.view('characters', 'crazy_ones', {
keys=severalKeys
},
function(err, body) {
  if (!err) {
    body.rows.forEach(function(doc) {
      console.log(doc.value);
    });
  }
});

then for your view

 exports.characters = {
  map: function(doc){
    if (doc.facebookId){
      emit(doc.facebookId, {_id: doc._id})
    }
  }
}

Important here is to omit []-brackets in the emit call!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants