lontongcorp / feathers-couchdb

Feathers couchdb adapter service using node-cradle
MIT License
15 stars 6 forks source link

Doesn't accept views that emit a null value #4

Open jay-jlm opened 7 years ago

jay-jlm commented 7 years ago

Let me know if this is expected behavior of it should be patched

Here's the error:

res[i].id = res[i]._id;
TypeError: Cannot read property '_id' of null

And here is the view:

function(doc) {
    if (doc._id.indexOf("test") == 0) {
        emit( [doc._id , 0], null)
        emit( [doc._id , 1], { _id: doc.index })
        emit( [doc._id , 2], { _id: doc.productType } )
    }
}