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

createIndex with TTL (expireAfterSeconds) is ignored and normal index created #74

Closed
LawrenceMouarkach opened this issue Jan 5, 2021 · 5 comments · Fixed by #77 or #95
Closed

Comments

@LawrenceMouarkach
Copy link

LawrenceMouarkach commented Jan 5, 2021

Hi,

When using this library I noticed whilst trying to create a TTL that it didnt work and a normal index was created please see below:

Actioned in change-log.xml
image

What was created in mongo:
image

┆Issue is synchronized with this Jira Bug by Unito

@LawrenceMouarkach
Copy link
Author

@alexandru-slobodcicov thoughts? I might fork this repo and look at fixing it if u do not have time at the moment, I will create a pr here if u want?

@LawrenceMouarkach
Copy link
Author

More info:

image

image

@LawrenceMouarkach
Copy link
Author

Change must be made here will work on it now:
image

@LawrenceMouarkach
Copy link
Author

Wouldnt let me create a pull request, please add following:
BsonUtils
if (options.containsKey("expireAfterSeconds")) { indexOptions.expireAfter(options.getLong("expireAfterSeconds"), TimeUnit.SECONDS); }
BsonUtilsTest
@Test void expireAfterSecondsTest() { assertThat(BsonUtils.orEmptyDocument("{expireAfterSeconds: NumberLong(\"60\")}").getLong("expireAfterSeconds")) .isEqualTo(60L); }

image
image

@alexandru-slobodcicov
Copy link

Thank you @LawrenceMouarkach for the detailed feedback, raised the PR target release 4.2.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants