-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added check for ignoreCase flag on RegExp queries. #26
Conversation
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test." |
Can one of the admins verify this patch? |
I have now signed the CLA. |
Correction: now I've signed the CLA. It would help if I paid attention to which account I'm signed in on. |
Can you add some tests to verify your changes and prevent regressions in the future? |
Disregard. I've figured out how to get |
I added the test yesterday, btw, in case Github didn't send a notification on that. |
@slnode test please |
@jftanner Status update: working on some CI issues to get greens before merging. Thanks for your patience. |
The patch LGTM FYI. ;) |
Depends on https://github.com/strongloop-internal/scrum-loopback/issues/1041 for CI checks cc @jannyHou |
Foo.find({where: {bar: {regexp: '^b'}}}, function(err, entries) { | ||
console.log (entries); | ||
entries.should.have.lengthOf(1); | ||
entries[0].bar.should.equal('b'); | ||
done(); | ||
}); | ||
}); | ||
it('find all foos that are case-insensitive B', function(done) { | ||
Foo.find({where: {bar: {regexp: '/B/i'}}}, function(err, entries) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (err) return done err;
Actually @TannDev, can you address the two new comments? Didn't notice them till now. |
@superkhau While I agree with both your comments, my added test matches the style of all the other tests in that file. Would you like to me change all the tests to reflect your comments? |
You are right in following the conventions outlined for consistency. The issue is that they are wrong to begin with. Please do not worry about it, @jannyHou has another PR that addresses the same issues anyways so we can fix it internally there. Thanks for the contribution, gonna merge. @jannyHou Can you remove the console logs here too later after you rebase? I forgot the PR, but it was the ESLint one I reviewed last time. |
Merging because CI for Cloudant isn't working properly anyways, no point waiting for greens. |
This is a fix for #25.
Cloudant.prototype.buildSelector
now parses theignoreCase
from RegExp objects and provides it to the$regex
operator in PCRE format by prepending(?i)
to the expression.