couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cory Zue <c...@dimagi.com>
Subject Re: doc coming back null even if include_docs specified
Date Wed, 21 Jul 2010 23:05:28 GMT
Ah, you are exactly right.  "working by design" then.  Thanks for the
pointer to the cool feature!

On Wed, Jul 21, 2010 at 6:47 PM, Zachary Zolton
<zachary.zolton@gmail.com> wrote:
> I think you might be running into the "Linked Document" feature:
>
> http://wiki.apache.org/couchdb/Introduction_to_CouchDB_views#Keys_and_values
> (Search for "Linked Document" on that page...)
>
> I'm guessing there isn't another document in the database with the ID
> "efg", right?
>
> On Wed, Jul 21, 2010 at 5:25 PM, Cory Zue <czue@dimagi.com> wrote:
>> I have a strange problem that I *think* is a bug in couchdb.
>>
>> I have a document with a child property, that itself has an _id field:
>>
>> {
>>  _id : "abc",
>>  child: { _id: "efg",
>>           somethingelse: 5 }
>> }
>>
>> then I have a view that's emitting the children as objects:
>>
>> function (doc) {
>>  if (doc.child) {
>>        emit(doc.child._id, doc.child);
>>  }
>> }
>>
>> This works fine, but when I query the view with include_docs=true it
>> still returns null for the doc.  However, if I lookup the doc by id it
>> is there.
>>
>> Is this a known problem?  Am I doing something wrong or illegal?
>>
>> This is in .11, I haven't tested in 1.0 yet.
>>
>> thanks,
>> Cory
>>
>

Mime
View raw message