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
Bug Fixes #245
Bug Fixes #245
Conversation
garrensmith
commented
Jan 25, 2017
- fix regex with default index
- Add some skip tests where Mango and pouchdb-find differ
- Fixes for default inde
- Fixes for field that is defined in an index but has isn't a logical operator
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.
Awesome fix, just a few small nits and then I'm +1 on this.
@@ -78,6 +82,10 @@ function rowFilter (doc, selector, inMemoryFields) { | |||
}); | |||
} | |||
|
|||
function isDesignDoc (doc) { | |||
return /_design/.test(doc._id); |
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.
should be /^_design\//
to start searching at the beginning of the string and include the /
@@ -131,6 +131,10 @@ function checkFieldsLogicallySound(indexFields, selector) { | |||
var firstField = indexFields[0]; | |||
var matcher = selector[firstField]; | |||
|
|||
if (matcher === undefined) { |
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.
typeof matcher === 'undefined'
is safer because some JS engines allow overwriting undefined
(i.e. it's a variable not a keyword)
}); | ||
}); | ||
|
||
it.skip('empty selector returns empty docs', function () { |
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.
did you mean to add a new skipped test?
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.
Yes I did mean to add this. I was going to fix it but I'm not sure if the issue is pouchdb-find or Mango. So I'm skipping it for now.
Fantastic, nice work! |