Package dev.morphia.annotations
Annotation Type Index
-
@Documented @Inherited @Retention(RUNTIME) @Target(ANNOTATION_TYPE) public @interface Index
Defines an index- Author:
- Scott Hernandez
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
background
Deprecated.use theIndexOptions
found inoptions()
boolean
disableValidation
Deprecated.use theIndexOptions
found inoptions()
boolean
dropDups
Deprecated.this functionality is no longer supported on the serverint
expireAfterSeconds
Deprecated.use theIndexOptions
found inoptions()
Field[]
fields
java.lang.String
name
Deprecated.use theIndexOptions
found inoptions()
IndexOptions
options
boolean
sparse
Deprecated.use theIndexOptions
found inoptions()
boolean
unique
Deprecated.use theIndexOptions
found inoptions()
java.lang.String
value
Deprecated.usefields()
-
-
-
-
options
IndexOptions options
- Returns:
- Options to apply to the index. Use of this field will ignore any of the deprecated options defined on
Index
directly.
- Default:
- @dev.morphia.annotations.IndexOptions
-
-
-
background
@Deprecated boolean background
Deprecated.use theIndexOptions
found inoptions()
- Returns:
- if true, create the index in the background
- Default:
- false
-
-
-
disableValidation
@Deprecated boolean disableValidation
Deprecated.use theIndexOptions
found inoptions()
- Returns:
- if true, disables validation for the field name
- Default:
- false
-
-
-
expireAfterSeconds
@Deprecated int expireAfterSeconds
Deprecated.use theIndexOptions
found inoptions()
- Returns:
- the time to live for documents in the collection
- Default:
- -1
-
-
-
name
@Deprecated java.lang.String name
Deprecated.use theIndexOptions
found inoptions()
- Returns:
- The name of the index to create; default is to let the mongodb create a name (in the form of key1_1/-1_key2_1/-1...)
- Default:
- ""
-
-
-
sparse
@Deprecated boolean sparse
Deprecated.use theIndexOptions
found inoptions()
- Returns:
- if true, create the index with the sparse option
- Default:
- false
-
-
-
unique
@Deprecated boolean unique
Deprecated.use theIndexOptions
found inoptions()
- Returns:
- if true, creates the index as a unique value index; inserting duplicates values in this field will cause errors
- Default:
- false
-
-