CouchDB multiple tags

前端 未结 6 1648
梦如初夏
梦如初夏 2021-02-13 16:25

Is there any way to have multiple tag search implemented in CouchDB? I have documents (posts) each with multiple tags. I need to find posts that have been tagged with an arbitra

6条回答
  •  萌比男神i
    2021-02-13 17:09

    In the more recent versions of CouchDB, you can POST to a view with a JSON document called keys, which allows for multi-key lookup. The structure would look something like this:

    {"keys": ["first_tag", "second_tag", "third_tag"]}
    

    This could be POSTed to a view that you have that is emitting tags for its respective keys.

    This and other querying options are documented here.

提交回复
热议问题