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
ConstructorDescriptionGeospatialIndex
(String field) Creates a newGeospatialIndex
for the given field. -
Method Summary
Modifier and TypeMethodDescriptionorg.bson.Document
Get theDocument
containing properties covered by the index.org.bson.Document
Get 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 newGeospatialIndex
for 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 theCollation
to specify language-specific rules for string comparison, such as rules for lettercase and accent marks.
NOTE: Only queries using the sameCollation
as theIndex
actually 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:IndexDefinition
Get theDocument
containing properties covered by the index.- Specified by:
getIndexKeys
in interfaceIndexDefinition
- Returns:
- never null.
-
getIndexOptions
public org.bson.Document getIndexOptions()Description copied from interface:IndexDefinition
Get the index properties such as unique,...- Specified by:
getIndexOptions
in interfaceIndexDefinition
- Returns:
- never null.
-
toString
-