Skip to content

Index creation for capped collection fails #87

@j13z

Description

@j13z

Hi,

I found an issue in the createCollection function that results in an unhandled promise rejection when using a capped collection ({ … capped: true, cappedMax: <n> … }) without TTL (expireAfterSeconds not set). There's a bug in the conditional at line 118, which causes the deletion of a non-existing index:

https://github.com/winstonjs/winston-mongodb/blob/master/lib/winston-mongodb.js#L118

With MongoDB 3.0.14, the indexInformation response has no expireAfterSeconds property, i.e. undefined, but self.expireAfterSeconds is false.

I created a pull request (#88) that fixes the issue. Would be nice if you could merge it and create a patch release. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions