DATAMONGO-963 - @CompoundIndex should treat expireAfterSeconds correctly.
We added an additional check on the fields used as key, so that TTL is ignored for CompoundIndex with more than one field (which effectively renders it useless on @CompoundIndex at all).
Prior to this change potentially invalid index structures would have been created for e.g. @CompoundIndex(def = "{'foo': 1, 'bar': 1}", expireAfterSeconds=10) leading to MongoDB not being able to clean up the indexes (logs: "ERROR: key for ttl index can only have 1 field")
This fix is related to https://jira.mongodb.org/browse/SERVER-10075.
Original pull request: #196.
pull/197/merge
Christoph Strobl12 years agocommitted byOliver Gierke
@ -215,6 +215,7 @@ public class MongoPersistentEntityIndexResolver implements IndexResolver {
@@ -215,6 +215,7 @@ public class MongoPersistentEntityIndexResolver implements IndexResolver {
@ -237,8 +238,14 @@ public class MongoPersistentEntityIndexResolver implements IndexResolver {
@@ -237,8 +238,14 @@ public class MongoPersistentEntityIndexResolver implements IndexResolver {
@ -289,9 +289,8 @@ public class MongoPersistentEntityIndexResolverUnitTests {
@@ -289,9 +289,8 @@ public class MongoPersistentEntityIndexResolverUnitTests {
@ -304,9 +303,8 @@ public class MongoPersistentEntityIndexResolverUnitTests {
@@ -304,9 +303,8 @@ public class MongoPersistentEntityIndexResolverUnitTests {
@ -322,7 +320,7 @@ public class MongoPersistentEntityIndexResolverUnitTests {
@@ -322,7 +320,7 @@ public class MongoPersistentEntityIndexResolverUnitTests {
@ -364,6 +362,22 @@ public class MongoPersistentEntityIndexResolverUnitTests {
@@ -364,6 +362,22 @@ public class MongoPersistentEntityIndexResolverUnitTests {
@ -400,6 +414,13 @@ public class MongoPersistentEntityIndexResolverUnitTests {
@@ -400,6 +414,13 @@ public class MongoPersistentEntityIndexResolverUnitTests {