Find CouchDB docs missing an arbitrary field

后端 未结 2 981
野性不改
野性不改 2021-01-21 07:44

I need a CouchDB view where I can get back all the documents that don\'t have an arbitrary field. This is easy to do if you know in advance what fields a document might

2条回答
  •  星月不相逢
    2021-01-21 08:11

    Without knowing the possible fields in advance, the answer is easy. You must create a new view to find the missing fields. The view will scan every document, one-by-one.

    To avoid disturbing your existing views and design documents, you can use a brand new design document. That way, searching for the missing fields will not impact existing views you may be already using.

提交回复
热议问题