createIndex with TTL (expireAfterSeconds) is ignored and normal index created
LawrenceMouarkach opened this issue · 5 comments
LawrenceMouarkach commented
LawrenceMouarkach commented
@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 commented
LawrenceMouarkach commented
LawrenceMouarkach commented
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); }
alexandru-slobodcicov commented
Thank you @LawrenceMouarkach for the detailed feedback, raised the PR target release 4.2.2.1