{"action":"created","issue":{"url":"https://api.github.com/repos/nolanlawson/pouchdb-find/issues/226","repository_url":"https://api.github.com/repos/nolanlawson/pouchdb-find","labels_url":"https://api.github.com/repos/nolanlawson/pouchdb-find/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/nolanlawson/pouchdb-find/issues/226/comments","events_url":"https://api.github.com/repos/nolanlawson/pouchdb-find/issues/226/events","html_url":"https://github.com/nolanlawson/pouchdb-find/issues/226","id":188968302,"number":226,"title":"$in doesn't work with $and","user":{"login":"Chozzle","id":11524191,"avatar_url":"https://avatars.githubusercontent.com/u/11524191?v=3","gravatar_id":"","url":"https://api.github.com/users/Chozzle","html_url":"https://github.com/Chozzle","followers_url":"https://api.github.com/users/Chozzle/followers","following_url":"https://api.github.com/users/Chozzle/following{/other_user}","gists_url":"https://api.github.com/users/Chozzle/gists{/gist_id}","starred_url":"https://api.github.com/users/Chozzle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chozzle/subscriptions","organizations_url":"https://api.github.com/users/Chozzle/orgs","repos_url":"https://api.github.com/users/Chozzle/repos","events_url":"https://api.github.com/users/Chozzle/events{/privacy}","received_events_url":"https://api.github.com/users/Chozzle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-13T12:44:49Z","updated_at":"2016-11-13T17:02:54Z","closed_at":null,"body":"```\r\n  $scope.updateStudyWord = function (wordlistId) {\r\n    localdb.createIndex({\r\n      index: {\r\n        fields: ['type', 'wordlistIds']\r\n      }\r\n    }).then(function () {\r\n      return localdb.find({\r\n        selector: {\r\n          type: 'word',\r\n          wordlistIds: {\r\n            $in: ['list3']\r\n          }\r\n        }\r\n      }).then(function (result) {\r\n        console.log(\"studylist:\", result);\r\n      }).catch(function (err) {\r\n        console.log(err);\r\n      })\r\n    })\r\n  };\r\n```\r\nConsole reads:\r\nTypeError: Cannot use 'in' operator to search for 'startkey' in undefined(…)\r\n\r\nHowever if I change the selector to:\r\n```\r\nselector: {\r\n          wordlistIds: {\r\n            $in: ['list3']\r\n          }\r\n        }\r\n```\r\nI get the correct document but with a warning. I'm not sure why I get the warning:\r\nConsole reads:\r\nstudylist: Object {docs: Array[1], warning: \"no matching index found, create an index to optimize query time\"}\r\n\r\nIf I select just the type: word, it works correctly\r\n```\r\nselector: {\r\n          type: 'word'\r\n        }\r\n```\r\nConsole reads:\r\nstudylist Object {docs: Array[3]}"},"comment":{"url":"https://api.github.com/repos/nolanlawson/pouchdb-find/issues/comments/260198260","html_url":"https://github.com/nolanlawson/pouchdb-find/issues/226#issuecomment-260198260","issue_url":"https://api.github.com/repos/nolanlawson/pouchdb-find/issues/226","id":260198260,"user":{"login":"Chozzle","id":11524191,"avatar_url":"https://avatars.githubusercontent.com/u/11524191?v=3","gravatar_id":"","url":"https://api.github.com/users/Chozzle","html_url":"https://github.com/Chozzle","followers_url":"https://api.github.com/users/Chozzle/followers","following_url":"https://api.github.com/users/Chozzle/following{/other_user}","gists_url":"https://api.github.com/users/Chozzle/gists{/gist_id}","starred_url":"https://api.github.com/users/Chozzle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chozzle/subscriptions","organizations_url":"https://api.github.com/users/Chozzle/orgs","repos_url":"https://api.github.com/users/Chozzle/repos","events_url":"https://api.github.com/users/Chozzle/events{/privacy}","received_events_url":"https://api.github.com/users/Chozzle/received_events","type":"User","site_admin":false},"created_at":"2016-11-13T17:02:54Z","updated_at":"2016-11-13T17:02:54Z","body":"Ok, I deleted and recreated the database and all indexes and it fixed both of the above errors. Maybe it is related to: #206  and some malformed indexes I had built previously."}}
{"actor":{"display_login":"Chozzle"}}