willholley opened a new pull request #881: Fix maximum key value when using JSON indexes URL: https://github.com/apache/couchdb/pull/881 ## Overview Mango previously constrained range queries against JSON indexes (map/reduce views) to startkey=[]&endkey=[{}]. In Mango, JSON index keys are always compound (i.e. always arrays), but this restriction resulted in Mango failing to match documents where the indexed value was an object. For example, an index with keys: [1], [2], [{"foo": 3}] would be restricted such that only [1] and [2] were returned if a range query was issued. On its own, this behaviour isn't necessarily unintuitive, but it is different from the behaviour of a non-indexed Mango query, so the query results would change in the presence of an index. Additonally, it prevented operators or selectors which explicitly depend on a full index scan (such as $exists) from returning a complete result set. This commit changes the maximum range boundary from [{}] to {}, so all array/compound keys will be included. ## Testing recommendations Create some documents with a field that contains a mix of value types - integers, strings, objects, nulls. Without adding an index, run some Mango queries using range operators (`$lt`, `$lte`, `$gt`, `$gte`) and those that depend on full index scans - `$exists`, `$regex` etc. If you then add a JSON index on the field, ensure you get the same results. ## GitHub issue number <!-- If this is a significant change, please file a separate issue at: https://github.com/apache/couchdb/issues and include the number here and in commit message(s) using syntax like "Fixes #472" or "Fixes apache/couchdb#472". --> ## Related Pull Requests <!-- If your changes affects multiple components in different repositories please put links to those 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: [email protected]
With regards, Apache Git Services
