Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTL indexes are created with "expireAfterSeconds" as String not Int #549

Closed
alexandre-slp opened this issue Oct 7, 2020 · 2 comments
Closed
Assignees
Labels

Comments

@alexandre-slp
Copy link

alexandre-slp commented Oct 7, 2020

When I create an index with TTL through the web interface and inspect it, the parameter "expireAfterSeconds"
has its value as String no Int. This causes that docs that should be deleted are not.

Expected Behavior

Use the web interface to create an Index with TTL and inspect it, the "expireAfterSeconds" should be an Int.

You should see something like this:

{
   "v": 2,
   "key": {
      "date": 1
   },
   "name": "date",
   "ns": "db.test",
   "expireAfterSeconds": 10 <---
}

Current Behavior

Use the web interface to create an Index with TTL and inspect it, the "expireAfterSeconds" and its a String.

You will see something like this:

{
   "v": 2,
   "key": {
      "date": 1
   },
   "name": "date",
   "ns": "db.test",
   "expireAfterSeconds": "10" <---
}

Steps to Reproduce

  1. Go to UI path to create the index: Management > Index Management
  2. Click "add Index"
  3. In "General", fill in the parameters: "index name", "field name" and "time to live"
  4. Click "save"
  5. To inspect the index just click on the "leaf" (Show Raw Json)

Context

Docs that should be deleted after the TTL are not.

Your Environment

  • Nosqlclient version used: 2.2.0
  • Environment name: Docker
@alexandre-slp
Copy link
Author

If you create the index through "Collections" and select "createIndex", the index is created correctly.

@alexandre-slp alexandre-slp changed the title TTL indexes are created with "expireAfterSeconds" as string not int TTL indexes are created with "expireAfterSeconds" as String not Int Oct 7, 2020
@rsercano
Copy link
Member

rsercano commented Oct 8, 2020

Thanks for reporting this @alexandre-slp I don't know how such a bug couldn't be found earlier. Also interestingly MongoDB nodejs driver accepts it as a string somehow 🤔

Fixed, as soon as build finished I'll also prepare the hotfix release.

@rsercano rsercano self-assigned this Oct 8, 2020
@rsercano rsercano added the bug label Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants