willholley opened a new pull request #1014: Fix index validation for nested $and
URL: https://github.com/apache/couchdb/pull/1014
 
 
   ## Overview
   
   mango_selector:has_required_fields checks that a list of
   indexed fields is covered by a given selector. The implementation
   recurses through the selector, tracking fields that encounters.
   
   Unfortunately, this skipped peers of combination operators. For
   example,
   
   ```
   "selector": {
        "$and":[
                "$and":[
                        "A": "foo"
                ],
                "$and":[
                        "B": "bar"
                ]
        ]
   }
   ```
   
   would skip the first nested "$and" operator and only return "B"
   as a covered field.
   
   This commit explicitly handles this situation (the only combination
   operator we care about is $and), so for the above selector we
   would correctly identify "A" and "B" as covered fields.
   
   ## Testing recommendations
   
   Run the test suite. Test that Query selectors with nested `$and` operators 
correctly use `json` indexes that should cover them.
   
   ## Related Issues or Pull Requests
   
   <!-- If your changes affects multiple components in different
        repositories please put links to those issues or pull requests here.  
-->
   
   ## Checklist
   
   - [ ] Code is written and works correctly;
   - [ ] 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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to