You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by gi...@git.apache.org on 2017/05/09 10:33:05 UTC

[GitHub] garrensmith opened a new pull request #511: Return false for empty list

garrensmith opened a new pull request #511: Return false for empty list
URL: https://github.com/apache/couchdb/pull/511
 
 
   ## Overview
   
   Currently if we have a document like this:
   ```
   doc = {
     name: 'Garren',
     activities: []
   };
   
   ```
   
   and then create a selector like this:
   
   ```
   find({selector: {
      activities: {
         $allMatch: {
           ['fishing', 'golf']
        }
      }
   });
   ```
   CouchDB mango will return the above document. This doesn't seem correct since it doesn't actually match the `$allMatch` selector. This PR changes that so that an empty document is false.
   
   ## Testing recommendations
   There is an additional test added to the Mango tests to prove this works.
   
   ## Checklist
   
   - [ ] Code is written and works correctly;
   - [ ] Changes are covered by tests;
   - [ ] Documentation reflects the changes;
   - [ ] I will not forget to update [rebar.config.script](https://github.com/apache/couchdb/blob/master/rebar.config.script)
         with the correct commit hash once this PR get merged.
   
 
----------------------------------------------------------------
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