Skip to content

TTL index creation fails when expireAt is 0 #291

@genert

Description

@genert

According to documentation, you can set expireAt to 0.

However, when using EnsureTTLIndex collection method provided by go-driver package:

_, _, err := col.EnsureTTLIndex(ctx, "expireAt", 0,  &driver.EnsureTTLIndexOptions{})
if err != nil {
    log.Fatal(err)
}

It fails with error:
Failed to create TTL index on collection cache field expireAt TTL 0: expireAfter attribute must be a number

When using any other positive integer instead of 0, the method call succeeds.

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