Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.