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. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ( && == '1') {
        emit(, 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


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

Browse other questions tagged or ask your own question.