{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/4540","repository_url":"https://api.github.com/repos/Automattic/mongoose","labels_url":"https://api.github.com/repos/Automattic/mongoose/issues/4540/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/mongoose/issues/4540/comments","events_url":"https://api.github.com/repos/Automattic/mongoose/issues/4540/events","html_url":"https://github.com/Automattic/mongoose/issues/4540","id":177747786,"number":4540,"title":"_markModified is not a function","user":{"login":"ignasg","id":12294040,"avatar_url":"https://avatars.githubusercontent.com/u/12294040?v=3","gravatar_id":"","url":"https://api.github.com/users/ignasg","html_url":"https://github.com/ignasg","followers_url":"https://api.github.com/users/ignasg/followers","following_url":"https://api.github.com/users/ignasg/following{/other_user}","gists_url":"https://api.github.com/users/ignasg/gists{/gist_id}","starred_url":"https://api.github.com/users/ignasg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignasg/subscriptions","organizations_url":"https://api.github.com/users/ignasg/orgs","repos_url":"https://api.github.com/users/ignasg/repos","events_url":"https://api.github.com/users/ignasg/events{/privacy}","received_events_url":"https://api.github.com/users/ignasg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Automattic/mongoose/labels/priority","name":"priority","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Automattic/mongoose/milestones/123","html_url":"https://github.com/Automattic/mongoose/milestones/4.6.2","labels_url":"https://api.github.com/repos/Automattic/mongoose/milestones/123/labels","id":1941282,"number":123,"title":"4.6.2","description":"","creator":{"login":"vkarpov15","id":1620265,"avatar_url":"https://avatars.githubusercontent.com/u/1620265?v=3","gravatar_id":"","url":"https://api.github.com/users/vkarpov15","html_url":"https://github.com/vkarpov15","followers_url":"https://api.github.com/users/vkarpov15/followers","following_url":"https://api.github.com/users/vkarpov15/following{/other_user}","gists_url":"https://api.github.com/users/vkarpov15/gists{/gist_id}","starred_url":"https://api.github.com/users/vkarpov15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkarpov15/subscriptions","organizations_url":"https://api.github.com/users/vkarpov15/orgs","repos_url":"https://api.github.com/users/vkarpov15/repos","events_url":"https://api.github.com/users/vkarpov15/events{/privacy}","received_events_url":"https://api.github.com/users/vkarpov15/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":5,"state":"open","created_at":"2016-08-14T22:22:02Z","updated_at":"2016-09-27T01:18:15Z","due_on":"2016-09-27T00:00:00Z","closed_at":null},"comments":3,"created_at":"2016-09-19T10:12:22Z","updated_at":"2016-09-27T01:25:05Z","closed_at":null,"body":"Was getting the following error after upgrading to latest mongoose:\r\n```\r\n\\node_modules\\mongoose\\lib\\types\\embedded.js:68\r\n    this.__parentArray._markModified();\r\n                       ^\r\nTypeError: undefined is not a function\r\n    at EmbeddedDocument.markModified (\\node_modules\\mongoose\\lib\\types\\embedded.js:68:24)\r\n    at SchemaArray.cast (\\node_modules\\mongoose\\lib\\schema\\array.js:180:9)\r\n    at SchemaArray.SchemaType.getDefault (\\node_modules\\mongoose\\lib\\schematype.js:587:23)\r\n    at EmbeddedDocument.Document.$__buildDoc (\\node_modules\\mongoose\\lib\\document.js:243:22)\r\n    at EmbeddedDocument.Document (\\node_modules\\mongoose\\lib\\document.js:61:20)\r\n    at new EmbeddedDocument (\\node_modules\\mongoose\\lib\\types\\embedded.js:30:12)\r\n    at EmbeddedDocument (\\node_modules\\mongoose\\lib\\schema\\documentarray.js:27:17)\r\n    at DocumentArray.SchemaArray (\\node_modules\\mongoose\\lib\\schema\\array.js:61:21)\r\n    at new DocumentArray (\\node_modules\\mongoose\\lib\\schema\\documentarray.js:46:13)\r\n    at Function.Schema.interpretAsType (\\node_modules\\mongoose\\lib\\schema.js:582:14)\r\n    at Schema.path (\\node_modules\\mongoose\\lib\\schema.js:527:29)\r\n    at Schema.add (\\node_modules\\mongoose\\lib\\schema.js:411:12)\r\n    at new Schema (\\node_modules\\mongoose\\lib\\schema.js:98:10)\r\n    at Object.<anonymous> (\\modules\\project\\server\\models\\project.server.model.js:71:21)\r\n    at Module._compile (module.js:460:26)\r\n    at Object.Module._extensions..js (module.js:478:10)\r\n    at Module.load (module.js:355:32)\r\n    at Function.Module._load (module.js:310:12)\r\n    at Module.require (module.js:365:17)\r\n    at require (module.js:384:17)\r\n    at \\config\\lib\\mongoose.js:15:5\r\n    at Array.forEach (native)\r\n```\r\n\r\nChanging \r\n```\r\nEmbeddedDocument.prototype.markModified = function(path) {\r\n  this.$__.activePaths.modify(path);\r\n  if (!this.__parentArray) {\r\n    return;\r\n  }\r\n```\r\n\r\nto\r\n```\r\nEmbeddedDocument.prototype.markModified = function(path) {\r\n  this.$__.activePaths.modify(path);\r\n  if (!this.__parentArray || !this.__parentArray._markModified) {\r\n    return;\r\n  }\r\n```\r\non node_modules\\mongoose\\lib\\types\\embedded.js\r\nseems to do the trick\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/comments/249742753","html_url":"https://github.com/Automattic/mongoose/issues/4540#issuecomment-249742753","issue_url":"https://api.github.com/repos/Automattic/mongoose/issues/4540","id":249742753,"user":{"login":"vkarpov15","id":1620265,"avatar_url":"https://avatars.githubusercontent.com/u/1620265?v=3","gravatar_id":"","url":"https://api.github.com/users/vkarpov15","html_url":"https://github.com/vkarpov15","followers_url":"https://api.github.com/users/vkarpov15/followers","following_url":"https://api.github.com/users/vkarpov15/following{/other_user}","gists_url":"https://api.github.com/users/vkarpov15/gists{/gist_id}","starred_url":"https://api.github.com/users/vkarpov15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkarpov15/subscriptions","organizations_url":"https://api.github.com/users/vkarpov15/orgs","repos_url":"https://api.github.com/users/vkarpov15/repos","events_url":"https://api.github.com/users/vkarpov15/events{/privacy}","received_events_url":"https://api.github.com/users/vkarpov15/received_events","type":"User","site_admin":false},"created_at":"2016-09-27T01:25:05Z","updated_at":"2016-09-27T01:25:05Z","body":"Workaround is good and all, but the workaround would just hide a potentially insidious bug. @bhishp do you have any additional code samples that can help?"}}
{"actor":{"display_login":"vkarpov15"}}