Package dev.morphia.annotations
Annotation Type Indexed
-
@Documented @Inherited @Retention(RUNTIME) @Target(FIELD) public @interface Indexed
Specified on fields that should be Indexed.- Author:
- Scott Hernandez
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
background
Deprecated.use theIndexOptions
found inoptions()
boolean
dropDups
Deprecated.Support for this has been removed from the server.int
expireAfterSeconds
Deprecated.use theIndexOptions
found inoptions()
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()
dev.morphia.utils.IndexDirection
value
-
-
-
Element Detail
-
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, creates the index in the background if true
- 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
-
-