{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/3758","labels_url":"https://api.github.com/repos/Automattic/mongoose/issues/3758/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/mongoose/issues/3758/comments","events_url":"https://api.github.com/repos/Automattic/mongoose/issues/3758/events","html_url":"https://github.com/Automattic/mongoose/issues/3758","id":126357575,"number":3758,"title":"this.listeners is not a fucnction","user":{"login":"badars","id":11393733,"avatar_url":"https://avatars.githubusercontent.com/u/11393733?v=3","gravatar_id":"","url":"https://api.github.com/users/badars","html_url":"https://github.com/badars","followers_url":"https://api.github.com/users/badars/followers","following_url":"https://api.github.com/users/badars/following{/other_user}","gists_url":"https://api.github.com/users/badars/gists{/gist_id}","starred_url":"https://api.github.com/users/badars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badars/subscriptions","organizations_url":"https://api.github.com/users/badars/orgs","repos_url":"https://api.github.com/users/badars/repos","events_url":"https://api.github.com/users/badars/events{/privacy}","received_events_url":"https://api.github.com/users/badars/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-13T07:11:49Z","updated_at":"2016-01-13T15:14:15Z","closed_at":"2016-01-13T15:14:15Z","body":"Its silly but i am thinking its better to be discussed here.\r\nI am using the key named 'listeners' in schema , something like\r\n```\r\nvar User = new Schema({\r\n         email: String,\r\n         listeners : [{\r\n                type: Schema.Types.ObjectId,\r\n                ref: 'User'\r\n        }],\r\n})\r\n\r\n```\r\n\r\nI am getting error from document.js:1774:12 , because listeners keyword is already reserved.  Is there any possibility to avoid this kind of issue by adding some pre keyword ? Thanks.\r\n```\r\nversion : 4.3.4\r\n````"},"comment":{"url":"https://api.github.com/repos/Automattic/mongoose/issues/comments/171325095","html_url":"https://github.com/Automattic/mongoose/issues/3758#issuecomment-171325095","issue_url":"https://api.github.com/repos/Automattic/mongoose/issues/3758","id":171325095,"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-01-13T15:14:15Z","updated_at":"2016-01-13T15:14:15Z","body":"No way to work around that, because one of the fundamental parts of a document is that it fulfills the event emitter API, which includes a `listeners()` function. Removing it would be a major backwards breaking change. Either rename the listeners field or move it away from the top level:\r\n\r\n```javascript\r\nvar User = new Schema({\r\n         email: String,\r\n         subdoc: {\r\n             listeners : [{\r\n                  type: Schema.Types.ObjectId,\r\n                  ref: 'User'\r\n              }]\r\n        },\r\n})\r\n```"}}