Skip to content

Conversation

@borigas
Copy link
Collaborator

@borigas borigas commented Apr 25, 2019

_rebels.Where(r => r.Age.In(new[] { 20 })) was querying with {"age":{"$in":20}}}, which CouchDb doesn't like. It looks like the special handling of 1 item arrays was in there for UseIndex(), so I moved that special case handling to UseIndex and let the rest of arrays include square brackets.

The last commit removes the 2nd constant handler and shares the 1st to reduce duplication. The change isn't strictly necessary, but I think it increases maintainability. If there's a side effect I'm not aware of, I'm happy to revert that

@borigas borigas changed the title Array query single item Support querying with single item array Apr 25, 2019
Copy link
Owner

@matteobortolazzo matteobortolazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice finding!
You are right, it was only for UseIndex, now is much better.
Thank you Ben.

@matteobortolazzo matteobortolazzo merged commit d793e7e into dev Apr 25, 2019
@matteobortolazzo matteobortolazzo deleted the ArrayQuerySingleItem branch April 25, 2019 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants