I'm trying to get documents for different selectors in one _find request. How is this possible to implement?
"selector": {
"$or": [
{"author": "007177e3-6719-4237-8903-fb397977889f"},
{"writers": {"$regex": "007177e3-6719-4237-8903-fb397977889f"}},
{"readers": {"$regex": "007177e3-6719-4237-8903-fb397977889f"}}
]
},
"use_index": "_design/5e0c1e3422759aefaa2aa14ed5a8323ba33f06e3",
"sort": [{"title": "asc"}],
"fields": ["_id", "_rev", "id", "title","author", "writers", "readers"]
Index used in request
{
"ddoc": "_design/5e0c1e3422759aefaa2aa14ed5a8323ba33f06e3",
"name": "title-json-index",
"type": "json",
"partitioned": false,
"def": {
"fields": [
{
"title": "asc"
}
]
}
},
In the response I only get document there author is "007177e3-6719-4237-8903-fb397977889f". Other selectors (writers, readers) are ignored.
Doc sample:
{
"_id": "scheme-44b2b6f6-9b42-40b5-86c3-6135cde2f99f",
"_rev": "6-bcbd906fd316e098fdd45eda3c11008f",
"id": "scheme-44b2b6f6-9b42-40b5-86c3-6135cde2f99f",
"title": "New scheme 25.02.2022",
"scope": "meta",
"created": "2022-02-25T05:43:45.546Z",
"modified": "2022-03-04T04:09:25.659Z",
"sharedUI": {
"schemeSharingLock": false,
"schemeRenameLock": false,
"schemeDeleteLock": false
},
"author": "007177e3-6719-4237-8903-fb397977889f",
"writers": "fff,007177e3-6719-4237-8903-fb397977889f,ccc",
"readers": "yyyy",
}
CouchDB version: 3.2.0