Skip to content
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

Merged
merged 3 commits into from Feb 1, 2017
Merged

Bug Fixes #245

merged 3 commits into from Feb 1, 2017

Conversation

garrensmith
Copy link
Collaborator

  • 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

* 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
Copy link
Owner

@nolanlawson nolanlawson left a 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);
Copy link
Owner

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) {
Copy link
Owner

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 () {
Copy link
Owner

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?

Copy link
Collaborator Author

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.

@nolanlawson
Copy link
Owner

Fantastic, nice work!

@nolanlawson nolanlawson merged commit 6349925 into master Feb 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants