couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Villiers <>
Subject view syntax for retrieving object without a field
Date Fri, 22 Jan 2010 15:38:00 GMT
I'm prototyping couchdb for a large application (for a possible migration from an oracle system).

I'l like to query my objects to get those _without_ a certain key.
My data:
{'id':'2','Type':'Article', country:'USA'}
{'id':'3','Type':'Article', country:'USA'}
{'id':'5','Type':'Article', country:null}

I'd like to get the object number 4 (no field 'country').

I tried with this view:

            function(doc) {
                if  (doc.Type == "Article") {
                  emit('country' in doc, doc);

With False as the request key but with no luck ...

Is that feasible with couchdb ? Could you advise ?



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message