couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <B.Cand...@pobox.com>
Subject Doc missing from view
Date Fri, 20 Mar 2009 11:37:23 GMT
Posted to user@ because I'm almost certainly being daft, but I just can't
see what I've done wrong.

I've used CouchRest to create a test document and view. But although the
document is there, and as far as I can see it matches the criteria in the
design doc to be emitted, the view is empty.

$ curl http://127.0.0.1:5984/central-dev/_all_docs
{"total_rows":4,"offset":0,"rows":[
{"id":"02dec9f03c81fbc296a540fdf0db614c","key":"02dec9f03c81fbc296a540fdf0db614c","value":{"rev":"3-881077382"}},
{"id":"2d3e7ceca688cfd9b217a9357f6aa428","key":"2d3e7ceca688cfd9b217a9357f6aa428","value":{"rev":"3-1498780430"}},
{"id":"_design/Foo-7ff2745f17e5e9c1d537f8202791e4fd","key":"_design/Foo-7ff2745f17e5e9c1d537f8202791e4fd","value":{"rev":"1-16600353"}},
{"id":"c6093c33be207512f3274a78620e0055","key":"c6093c33be207512f3274a78620e0055","value":{"rev":"2-3661506978"}}
]}

$ curl http://127.0.0.1:5984/central-dev/02dec9f03c81fbc296a540fdf0db614c
{"_id":"02dec9f03c81fbc296a540fdf0db614c","_rev":"3-881077382","wibble":"bibble","foo":"bar","couchrest-type":"Foo"}

$ curl http://127.0.0.1:5984/central-dev/_design/Foo-7ff2745f17e5e9c1d537f8202791e4fd
{"_id":"_design/Foo-7ff2745f17e5e9c1d537f8202791e4fd","_rev":"1-16600353","language":"javascript","views":{"all":{"map":"function(doc)
{\n                  if (doc['couchrest-type'] == 'Foo') {\n                    emit(null,null);\n
                 }\n                }"},"by_foo_and_bar":{"map":"function(doc) {\n  if ((doc['couchrest-type']
== 'Foo') && doc['foo'] && doc['bar']) {\n    emit([doc['foo'], doc['bar']],
null);\n  }\n}\n"},"by_foo":{"map":"function(doc) {\n  if ((doc['couchrest-type'] == 'Foo')
&& doc['foo']) {\n    emit(doc['foo'], null);\n  }\n}\n"}}}

$ curl http://127.0.0.1:5984/central-dev/_design/Foo-7ff2745f17e5e9c1d537f8202791e4fd/_view/all
{"total_rows":0,"rows":[]}
???!

$ curl http://127.0.0.1:5984/central-dev/_design/Foo-7ff2745f17e5e9c1d537f8202791e4fd/_view/by_foo
{"total_rows":0,"rows":[]}
???!

This is with CouchDB r755146 compiled a couple of days ago.

Regards,

Brian.

Mime
View raw message