Spring Data MongoDB - Core

org.springframework.data.mongodb.core.index
Annotation Type Indexed


@Target(value=FIELD)
@Retention(value=RUNTIME)
public @interface Indexed

Mark a field to be indexed using MongoDB's indexing feature.

Author:
Jon Brisbin, Oliver Gierke, Philipp Schneider, Johno Crawford

Optional Element Summary
 boolean background
          If true the index will be created in the background.
 String collection
           
 IndexDirection direction
           
 boolean dropDups
           
 int expireAfterSeconds
          Configures the number of seconds after which the collection should expire.
 String name
           
 boolean sparse
           
 boolean unique
           
 

unique

public abstract boolean unique
Default:
false

direction

public abstract IndexDirection direction
Default:
org.springframework.data.mongodb.core.index.IndexDirection.ASCENDING

sparse

public abstract boolean sparse
Default:
false

dropDups

public abstract boolean dropDups
Default:
false

name

public abstract String name
Default:
""

collection

public abstract String collection
Default:
""

background

public abstract boolean background
If true the index will be created in the background.

Returns:
See Also:
http://docs.mongodb.org/manual/core/indexes/#background-construction
Default:
false

expireAfterSeconds

public abstract int expireAfterSeconds
Configures the number of seconds after which the collection should expire. Defaults to -1 for no expiry.

Returns:
See Also:
http://docs.mongodb.org/manual/tutorial/expire-data/
Default:
-1

Spring Data MongoDB - Core

Copyright © 2011-2013-2014 Pivotal. All Rights Reserved.