{"action":"closed","issue":{"url":"https://api.github.com/repos/sabymike/mongoose-relationship/issues/10","labels_url":"https://api.github.com/repos/sabymike/mongoose-relationship/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/sabymike/mongoose-relationship/issues/10/comments","events_url":"https://api.github.com/repos/sabymike/mongoose-relationship/issues/10/events","html_url":"https://github.com/sabymike/mongoose-relationship/issues/10","id":52074970,"number":10,"title":"Object  has no method 'updateCollectionForRelationship'","user":{"login":"mafcm","id":8848104,"avatar_url":"https://avatars.githubusercontent.com/u/8848104?v=3","gravatar_id":"","url":"https://api.github.com/users/mafcm","html_url":"https://github.com/mafcm","followers_url":"https://api.github.com/users/mafcm/followers","following_url":"https://api.github.com/users/mafcm/following{/other_user}","gists_url":"https://api.github.com/users/mafcm/gists{/gist_id}","starred_url":"https://api.github.com/users/mafcm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mafcm/subscriptions","organizations_url":"https://api.github.com/users/mafcm/orgs","repos_url":"https://api.github.com/users/mafcm/repos","events_url":"https://api.github.com/users/mafcm/events{/privacy}","received_events_url":"https://api.github.com/users/mafcm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sabymike/mongoose-relationship/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-12-16T05:27:05Z","updated_at":"2015-09-17T20:20:22Z","closed_at":"2015-09-17T20:20:22Z","body":"Hi,\r\n\r\nIt's my first time using mongoose. I built relationship between two model **User** and **Post** and I get an error.\r\n\r\nI was running this code\r\n```\r\nUser.findOne({ _id : \"53f57c1aeb844b2c068b4569\" }, function(err, u) {\r\n\tif (err) {\r\n\t\thandleError(err);\r\n\t}\r\n\r\n\tif (u) {\r\n\t\tconsole.log(u);\r\n\t\tconsole.log(u._id);\r\n\r\n\t\tnew Post({\r\n\t\t\tauthor : u\r\n\t\t}).save(function(err, p) {\r\n\t\t\tif (err) {\r\n\t\t\t\thandleError(err);\r\n\t\t\t}\r\n\t\t\tconsole.log(p);\r\n\t\t});\r\n\t}\r\n});\r\n```\r\nwhen I get this error \r\n```\r\nTypeError: Object { author: 53f57c1aeb844b2c068b4569,\r\n  _id: 548fc0c38615a22816a28be7,\r\n  items: [],\r\n  updated_at: Tue Dec 16 2014 06:18:59 GMT+0100 (WAT),\r\n  created_at: Tue Dec 16 2014 06:18:59 GMT+0100 (WAT),\r\n  description: 'Description',\r\n  title: 'Title' } has no method 'updateCollectionForRelationship'\r\n    at /usr/local/lib/node_modules/mongoose-relationship/index.js:129:26\r\n    at /usr/local/lib/node_modules/mongoose-relationship/node_modules/async/lib/async.js:111:13\r\n    at Array.forEach (native)\r\n    at _each (/usr/local/lib/node_modules/mongoose-relationship/node_modules/async/lib/async.js:32:24)\r\n    at Object.async.each (/usr/local/lib/node_modules/mongoose-relationship/node_modules/async/lib/async.js:110:9)\r\n    at model.<anonymous> (/usr/local/lib/node_modules/mongoose-relationship/index.js:125:15)\r\n    at _next (/usr/local/lib/node_modules/mongoose/node_modules/hooks/hooks.js:50:30)\r\n    at fnWrapper (/usr/local/lib/node_modules/mongoose/node_modules/hooks/hooks.js:159:8)\r\n    at complete (/usr/local/lib/node_modules/mongoose/lib/document.js:986:5)\r\n    at /usr/local/lib/node_modules/mongoose/lib/document.js:977:20\r\n```\r\n\r\nHow to solve it please ?"}}