Module spring.data.mongodb
Class GeospatialIndex
java.lang.Object
org.springframework.data.mongodb.core.index.GeospatialIndex
- All Implemented Interfaces:
IndexDefinition
Value object to capture data to create a geo index.
- Author:
- Jon Brisbin, Oliver Gierke, Laurent Canet, Christoph Strobl, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionGeospatialIndex(String field) Creates a newGeospatialIndexfor the given field. -
Method Summary
Modifier and TypeMethodDescriptionorg.bson.DocumentGet theDocumentcontaining properties covered by the index.org.bson.DocumentGet the index properties such as unique,...partial(IndexFilter filter) Only index the documents in a collection that meet a specifiedfilter expression.toString()typed(GeoSpatialIndexType type) withAdditionalField(String fieldName) withBits(int bits) withBucketSize(double bucketSize) Deprecated.since MongoDB server version 4.4withMax(int max) withMin(int min)
-
Constructor Details
-
GeospatialIndex
Creates a newGeospatialIndexfor the given field.- Parameters:
field- must not be empty or null.
-
-
Method Details
-
named
- Parameters:
name- must not be null or empty.- Returns:
- this.
-
withMin
- Parameters:
min-- Returns:
- this.
-
withMax
- Parameters:
max-- Returns:
- this.
-
withBits
- Parameters:
bits-- Returns:
- this.
-
typed
- Parameters:
type- must not be null.- Returns:
- this.
-
withBucketSize
Deprecated.since MongoDB server version 4.4- Parameters:
bucketSize-- Returns:
- this.
-
withAdditionalField
- Parameters:
fieldName-- Returns:
- this.
-
partial
Only index the documents in a collection that meet a specifiedfilter expression.- Parameters:
filter- can be null.- Returns:
- this.
- Since:
- 1.10
- See Also:
-
collation
Set theCollationto specify language-specific rules for string comparison, such as rules for lettercase and accent marks.
NOTE: Only queries using the sameCollationas theIndexactually make use of the index.- Parameters:
collation- can be null.- Returns:
- this.
- Since:
- 2.0
-
getIndexKeys
public org.bson.Document getIndexKeys()Description copied from interface:IndexDefinitionGet theDocumentcontaining properties covered by the index.- Specified by:
getIndexKeysin interfaceIndexDefinition- Returns:
- never null.
-
getIndexOptions
public org.bson.Document getIndexOptions()Description copied from interface:IndexDefinitionGet the index properties such as unique,...- Specified by:
getIndexOptionsin interfaceIndexDefinition- Returns:
- never null.
-
toString
-