You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/11/07 09:32:48 UTC

[GitHub] garrensmith opened a new pull request #1718: Perform explicit $exists:false on Index validation

garrensmith opened a new pull request #1718: Perform explicit $exists:false on Index validation
URL: https://github.com/apache/couchdb/pull/1718
 
 
   ## Overview
   
   When selecting an index for a mango query, the mango index selector can incorrectly choose an index when a selector has an exists: false for a field in the index along with another condition for that same field. E.g:
   
   Index with fields = ["tags] and selector:
   
   ``` js
   Selector: {
       $or: [
         {
           tags: {
             $elemMatch: {
               $eq: "tag1"
             }
           }
         },
         {
           tags: { $exists: False }
         }
       ]
     }
   };
   ```
   
   In the above case, mango will select the index instead of falling back to `_all_docs`.
   
   ## Testing recommendations
   
   * Create similar queries like the above and make sure the index is not selected. 
   * All Mango tests should pass.
   
   ## Checklist
   
   - [x] Code is written and works correctly;
   - [x] Changes are covered by tests;
   - [ ] Documentation reflects the changes;
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services