Class WildcardIndex

java.lang.Object
org.springframework.data.mongodb.core.index.Index
org.springframework.data.mongodb.core.index.WildcardIndex
All Implemented Interfaces:
IndexDefinition

public class WildcardIndex extends Index
WildcardIndex is a specific Index that can be used to include all fields into an index based on the $**" : 1 pattern on a root object (the one typically carrying the Document annotation). On those it is possible to use wildcardProjectionInclude(String...) and wildcardProjectionExclude(String...) to define specific paths for in-/exclusion.
It can also be used to define an index on a specific field path and its subfields, e.g. "path.to.field.$**" : 1.
Note that wildcardProjections are not allowed in this case.
LIMITATIONS
  • Unique and ttl options are not supported.
  • Keys used for sharding must not be included
  • Cannot be used to generate any type of geo index.
Since:
3.3
Author:
Christoph Strobl
See Also: