Annotation Type Indexed


  • @Documented
    @Inherited
    @Retention(RUNTIME)
    @Target(FIELD)
    public @interface Indexed
    Specified on fields that should be Indexed.
    Author:
    Scott Hernandez
    • 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 the IndexOptions found in options()
        Returns:
        if true, creates the index in the background if true
        Default:
        false
      • dropDups

        @Deprecated
        boolean dropDups
        Deprecated.
        Support for this has been removed from the server. This value is ignored.
        Returns:
        if true, tells the unique index to drop duplicates silently when creating; only the first will be kept
        Default:
        false
      • expireAfterSeconds

        @Deprecated
        int expireAfterSeconds
        Deprecated.
        use the IndexOptions found in options()
        Returns:
        the time to live for documents in the collection
        Default:
        -1
      • name

        @Deprecated
        java.lang.String name
        Deprecated.
        use the IndexOptions found in options()
        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 the IndexOptions found in options()
        Returns:
        if true, create the index with the sparse option
        Default:
        false
      • unique

        @Deprecated
        boolean unique
        Deprecated.
        use the IndexOptions found in options()
        Returns:
        if true, creates the index as a unique value index; inserting duplicates values in this field will cause errors
        Default:
        false
      • value

        dev.morphia.utils.IndexDirection value
        Returns:
        the type of the index (ascending, descending, geo2d); default is ascending
        See Also:
        IndexDirection
        Default:
        dev.morphia.utils.IndexDirection.ASC