janmonschke / backbone-couchdb

A couchdb connector for backbone with support for real time changes.

Home Page:http://janmonschke.com/projects/backbone-couchdb.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I don't think doc.doc is what is needed during a fetch

mikeymckay opened this issue · comments

I think this line:

    for doc in data.rows
      if doc.value then _temp.push doc.value else _temp.push doc.doc

from:
https://github.com/janmonschke/backbone-couchdb/blob/master/backbone-couchdb.coffee#L75

Should be:

    for doc in data.rows
      if doc.value then _temp.push doc.value else _temp.push doc

At least that is what I need to handle a view with include_docs turned off. This will still set the id for each model. I am not sure what doc.doc handles though, so I will probably leave it in just in case:

    for doc in data.rows
      if doc.value 
        _temp.push doc.value 
      else if doc.doc
        _temp.push doc.doc
      else
        _temp.push doc