{"action":"created","issue":{"url":"https://api.github.com/repos/winstonjs/winston-mongodb/issues/78","repository_url":"https://api.github.com/repos/winstonjs/winston-mongodb","labels_url":"https://api.github.com/repos/winstonjs/winston-mongodb/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/winstonjs/winston-mongodb/issues/78/comments","events_url":"https://api.github.com/repos/winstonjs/winston-mongodb/issues/78/events","html_url":"https://github.com/winstonjs/winston-mongodb/pull/78","id":189824830,"number":78,"title":"Fixed bad logical operator test for setting expireAfterSeconds option…","user":{"login":"jaydub2099","id":505426,"avatar_url":"https://avatars.githubusercontent.com/u/505426?v=3","gravatar_id":"","url":"https://api.github.com/users/jaydub2099","html_url":"https://github.com/jaydub2099","followers_url":"https://api.github.com/users/jaydub2099/followers","following_url":"https://api.github.com/users/jaydub2099/following{/other_user}","gists_url":"https://api.github.com/users/jaydub2099/gists{/gist_id}","starred_url":"https://api.github.com/users/jaydub2099/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaydub2099/subscriptions","organizations_url":"https://api.github.com/users/jaydub2099/orgs","repos_url":"https://api.github.com/users/jaydub2099/repos","events_url":"https://api.github.com/users/jaydub2099/events{/privacy}","received_events_url":"https://api.github.com/users/jaydub2099/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-16T19:55:46Z","updated_at":"2016-12-11T17:13:57Z","closed_at":"2016-12-11T17:03:14Z","pull_request":{"url":"https://api.github.com/repos/winstonjs/winston-mongodb/pulls/78","html_url":"https://github.com/winstonjs/winston-mongodb/pull/78","diff_url":"https://github.com/winstonjs/winston-mongodb/pull/78.diff","patch_url":"https://github.com/winstonjs/winston-mongodb/pull/78.patch"},"body":"I was trying to implement the new expireAfterSeconds option to winston-mongodb and the TTL index was not created on any of my logging collections, even if I dropped the collections and let winston-mongodb recreate them. I believe that the problem is that despite the docs saying that the expireAfterSeconds option only is in play if the capped option is NOT set, the code for setting the expireAfterSeconds option actually has a logical operator test that checks if 'this.capped && options.expireAfterSeconds'. With that test, if capped is set as false or false via default, then the expireAfterSeconds option is actually not evaluated.\r\n\r\nI tested simply changing this.capped to !this.capped and the result was successful creation of my logging collections with the TTL index.\r\n\r\nNote I am testing on 1.6.5 since we are not ready to move to node 6.x but the change is a one liner and so should apply just the same on the 2.x version."},"comment":{"url":"https://api.github.com/repos/winstonjs/winston-mongodb/issues/comments/266293994","html_url":"https://github.com/winstonjs/winston-mongodb/pull/78#issuecomment-266293994","issue_url":"https://api.github.com/repos/winstonjs/winston-mongodb/issues/78","id":266293994,"user":{"login":"39dotyt","id":4187729,"avatar_url":"https://avatars.githubusercontent.com/u/4187729?v=3","gravatar_id":"","url":"https://api.github.com/users/39dotyt","html_url":"https://github.com/39dotyt","followers_url":"https://api.github.com/users/39dotyt/followers","following_url":"https://api.github.com/users/39dotyt/following{/other_user}","gists_url":"https://api.github.com/users/39dotyt/gists{/gist_id}","starred_url":"https://api.github.com/users/39dotyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/39dotyt/subscriptions","organizations_url":"https://api.github.com/users/39dotyt/orgs","repos_url":"https://api.github.com/users/39dotyt/repos","events_url":"https://api.github.com/users/39dotyt/events{/privacy}","received_events_url":"https://api.github.com/users/39dotyt/received_events","type":"User","site_admin":false},"created_at":"2016-12-11T17:13:57Z","updated_at":"2016-12-11T17:13:57Z","body":"Thank you. Merged. Released in 1.6.6 and 2.0.1."}}
{"actor":{"display_login":"39dotyt"}}