{"action":"created","issue":{"url":"https://api.github.com/repos/pouchdb-community/relational-pouch/issues/97","repository_url":"https://api.github.com/repos/pouchdb-community/relational-pouch","labels_url":"https://api.github.com/repos/pouchdb-community/relational-pouch/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/pouchdb-community/relational-pouch/issues/97/comments","events_url":"https://api.github.com/repos/pouchdb-community/relational-pouch/issues/97/events","html_url":"https://github.com/pouchdb-community/relational-pouch/issues/97","id":321146494,"number":97,"title":"Problem obtaining related records","user":{"login":"luca147","id":11593165,"avatar_url":"https://avatars2.githubusercontent.com/u/11593165?v=4","gravatar_id":"","url":"https://api.github.com/users/luca147","html_url":"https://github.com/luca147","followers_url":"https://api.github.com/users/luca147/followers","following_url":"https://api.github.com/users/luca147/following{/other_user}","gists_url":"https://api.github.com/users/luca147/gists{/gist_id}","starred_url":"https://api.github.com/users/luca147/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luca147/subscriptions","organizations_url":"https://api.github.com/users/luca147/orgs","repos_url":"https://api.github.com/users/luca147/repos","events_url":"https://api.github.com/users/luca147/events{/privacy}","received_events_url":"https://api.github.com/users/luca147/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-08T11:24:34Z","updated_at":"2018-05-14T12:34:12Z","closed_at":null,"author_association":"NONE","body":"This is how I defined the scheme, but when I proceed to obtain the \"work\", the json that is returned to me brings to me all the works and reports. Not respecting the work id for which I am looking for.\r\n\r\n@nolanlawson can you help me?, I'm thinking of using only pouchdb without this plugin.\r\n\r\n//Schema definition\r\nthis.db.setSchema([\r\n      {\r\n        singular: 'cliente',\r\n        plural: 'clientes',\r\n        relations: {\r\n          trabajos: { hasMany: { type: 'trabajo', options: { queryInverse: 'cliente' } } }\r\n        }\r\n      },\r\n      {\r\n        singular: 'trabajo',\r\n        plural: 'trabajos',\r\n        relations: {\r\n          'cliente': { belongsTo: 'cliente' },\r\n          informes: { hasMany: { type: 'informe', options: { queryInverse: 'trabajo' } } }\r\n        }\r\n      },\r\n      {\r\n        singular: 'informe',\r\n        plural: 'informes',\r\n        relations: {\r\n          'trabajo': { belongsTo: 'trabajo' }\r\n        }\r\n      }\r\n    ]);\r\n\r\n    //Index's\r\n    this.db.createIndex({\r\n      index: {\r\n        fields: ['data.cliente', '_id']\r\n      }\r\n    }).then(function (result) {\r\n      // handle result\r\n      console.log('Index creado: ' + JSON.stringify(result));\r\n    }).catch(function (err) {\r\n      console.log('Index creation error: ' + err);\r\n    });\r\n\r\n    this.db.createIndex({\r\n      index: {\r\n        fields: ['_id', 'data.trabajo']\r\n      }\r\n    }).then(function (result) {\r\n      // handle result\r\n      console.log('Index creado: ' + JSON.stringify(result));\r\n    }).catch(function (err) {\r\n      console.log('Index creation error: ' + err);\r\n    });"},"comment":{"url":"https://api.github.com/repos/pouchdb-community/relational-pouch/issues/comments/388800701","html_url":"https://github.com/pouchdb-community/relational-pouch/issues/97#issuecomment-388800701","issue_url":"https://api.github.com/repos/pouchdb-community/relational-pouch/issues/97","id":388800701,"user":{"login":"luca147","id":11593165,"avatar_url":"https://avatars2.githubusercontent.com/u/11593165?v=4","gravatar_id":"","url":"https://api.github.com/users/luca147","html_url":"https://github.com/luca147","followers_url":"https://api.github.com/users/luca147/followers","following_url":"https://api.github.com/users/luca147/following{/other_user}","gists_url":"https://api.github.com/users/luca147/gists{/gist_id}","starred_url":"https://api.github.com/users/luca147/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luca147/subscriptions","organizations_url":"https://api.github.com/users/luca147/orgs","repos_url":"https://api.github.com/users/luca147/repos","events_url":"https://api.github.com/users/luca147/events{/privacy}","received_events_url":"https://api.github.com/users/luca147/received_events","type":"User","site_admin":false},"created_at":"2018-05-14T12:34:11Z","updated_at":"2018-05-14T12:34:11Z","author_association":"NONE","body":"@509dave16 thanks dave,  in the same way I decided don't use the plugin and do it myself using pouch and the plugin find.\r\n\r\nThanks a lot for the reply!"}}
{"actor":{"display_login":"luca147"}}