2

Not sure if/how it is intended to be done but i am trying to match up all the active document in my database with the author of it:

function(doc) {
    if (doc.data.active && doc.data.active == '1') {
        emit(doc.data._account.data.name, doc._id);
    }
}

the _account field in the db is a reference to a document with all the information about the author, including a name field but because this is a reference I cannot simply "go down".

I tried to look up the docs but kind of hard to find relevant documentation because reference match up to Reference documentation most of the time.

  • I think you're going about this the wrong way...if you want to match the active documents to its author, then you've got to have something of the form emit(doc._id, doc.author_id) Then you can include_docs=true and get the author doc for a given active article... – Alex Nelson Apr 16 '13 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.