{"action":"created","issue":{"url":"https://api.github.com/repos/nolanlawson/relational-pouch/issues/44","labels_url":"https://api.github.com/repos/nolanlawson/relational-pouch/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/nolanlawson/relational-pouch/issues/44/comments","events_url":"https://api.github.com/repos/nolanlawson/relational-pouch/issues/44/events","html_url":"https://github.com/nolanlawson/relational-pouch/issues/44","id":109246275,"number":44,"title":"db.rel.find(type, id) returns all 'type' docs, not only doc with that id.","user":{"login":"ramonsan","id":10634628,"avatar_url":"https://avatars.githubusercontent.com/u/10634628?v=3","gravatar_id":"","url":"https://api.github.com/users/ramonsan","html_url":"https://github.com/ramonsan","followers_url":"https://api.github.com/users/ramonsan/followers","following_url":"https://api.github.com/users/ramonsan/following{/other_user}","gists_url":"https://api.github.com/users/ramonsan/gists{/gist_id}","starred_url":"https://api.github.com/users/ramonsan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramonsan/subscriptions","organizations_url":"https://api.github.com/users/ramonsan/orgs","repos_url":"https://api.github.com/users/ramonsan/repos","events_url":"https://api.github.com/users/ramonsan/events{/privacy}","received_events_url":"https://api.github.com/users/ramonsan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-01T07:43:38Z","updated_at":"2015-10-04T17:47:28Z","closed_at":"2015-10-04T17:47:28Z","body":"Also happens with db.rel.find(type, ids). If you take the example from readme:\r\n```\r\n          var db = new PouchDB('mydb');\r\n          db.setSchema([\r\n              {singular: 'author', plural: 'authors', relations: { books: {hasMany: 'book'}}},\r\n              {singular: 'book', plural: 'books', relations: {author: {belongsTo: 'author'}}}\r\n          ]);\r\n          db.rel.save('author', {\r\n              name: 'George R. R. Martin', id: 1, books: [6, 7]\r\n          }).then(function () {\r\n              return db.rel.save('book', { title: 'A Game of Thrones', id: 6, author: 1});\r\n          }).then(function () {\r\n              return db.rel.save('book', {title: 'The Hedge Knight', id: 7, author: 1});\r\n          }).catch(console.log.bind(console));\r\n```\r\nAnd then you want find book with id 7:\r\n\r\n```\r\n          db.rel.find('book',7).then(function(doc){\r\n              console.log(doc);\r\n          });\r\n```\r\n\r\nYou got as result all books:\r\n```\r\n{\r\n    \"books\" : [\r\n        {\r\n            \"title\" : \"A Game of Thrones\",\r\n            \"author\" : 1,\r\n            \"id\" : 6,\r\n            \"rev\" : \"1-16ce4f20eae39bd0655f00f81973dd14\"\r\n        },\r\n        {\r\n            \"title\" : \"The Hedge Knight\",\r\n            \"author\" : 1,\r\n            \"id\" : 7,\r\n            \"rev\" : \"1-7d35db00e3b7df172e33173eded5ab72\"\r\n        }\r\n    ],\r\n    \"authors\" : [\r\n        {\r\n            \"name\" : \"George R. R. Martin\",\r\n            \"books\" : [\r\n                 6,\r\n                 7\r\n            ],\r\n            \"id\" : 1,\r\n            \"rev\" : \"1-c4c9b023321d67787d737421837988e3\"\r\n        }\r\n    ]\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/nolanlawson/relational-pouch/issues/comments/145369048","html_url":"https://github.com/nolanlawson/relational-pouch/issues/44#issuecomment-145369048","issue_url":"https://api.github.com/repos/nolanlawson/relational-pouch/issues/44","id":145369048,"user":{"login":"nolanlawson","id":283842,"avatar_url":"https://avatars.githubusercontent.com/u/283842?v=3","gravatar_id":"","url":"https://api.github.com/users/nolanlawson","html_url":"https://github.com/nolanlawson","followers_url":"https://api.github.com/users/nolanlawson/followers","following_url":"https://api.github.com/users/nolanlawson/following{/other_user}","gists_url":"https://api.github.com/users/nolanlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanlawson/subscriptions","organizations_url":"https://api.github.com/users/nolanlawson/orgs","repos_url":"https://api.github.com/users/nolanlawson/repos","events_url":"https://api.github.com/users/nolanlawson/events{/privacy}","received_events_url":"https://api.github.com/users/nolanlawson/received_events","type":"User","site_admin":false},"created_at":"2015-10-04T17:47:28Z","updated_at":"2015-10-04T17:47:28Z","body":"Thanks for reporting! This is actually by design; you can omit dependent objects by using async relations: https://github.com/nolanlawson/relational-pouch#async-relationships"}}