Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

98
Views
¿Cómo usar la solicitud couchdb _find con varios selectores?

Estoy tratando de obtener documentos para diferentes selectores en una solicitud _find. ¿Cómo es posible implementar esto?

 "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"]

Índice utilizado en la solicitud

 { "ddoc": "_design/5e0c1e3422759aefaa2aa14ed5a8323ba33f06e3", "name": "title-json-index", "type": "json", "partitioned": false, "def": { "fields": [ { "title": "asc" } ] } },

En la respuesta, solo recibo el documento donde el autor es "007177e3-6719-4237-8903-fb397977889f". Se ignoran otros selectores (escritores, lectores).

Ejemplo de documento:

 { "_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", }

Versión de CouchDB: 3.2.0

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!