Norman,

Your best bet would be to emit something that flags that the property
doesn't exist. Perhaps something like:

emit(doc.a || null, null)

And then query for key=null

Granted that munges when doc.a is null. To be complete you'd need to
do something like:

if(doc.a !== undefined) {
    emit([doc.a], null):
} else {
    emit(null, null);
}

HTH,
Paul Davis

On Sat, Oct 31, 2009 at 6:21 PM, Norman Barker <[email protected]> wrote:
> Hi,
>
> is there a way to specify a key for a view such that the view returns
> all results that don't have that key?
>
> e.g. myview?key="~a", returns all documents with keys equal to b, c, d, ...
>
> I appreciate that I could get all document ids and then query for all
> documents with key 'a' and then return the difference but then I lose
> the advantage of being able to page the result.
>
> Has anyone tried this?
>
> thanks,
>
> Norman
>

Reply via email to