public final class Indexes extends Object
Indexes将其扩展,支持函数| 限定符和类型 | 方法和说明 |
|---|---|
static org.bson.conversions.Bson |
ascending(List<String> fieldNames)
为给定字段的升序索引创建索引键。
|
static org.bson.conversions.Bson |
ascending(String... fieldNames)
为给定字段的升序索引创建索引键。
|
static <T> org.bson.conversions.Bson |
ascendingFunc(List<SFunction<T,Object>> fieldNames)
为给定字段的升序索引创建索引键。
|
static <T> org.bson.conversions.Bson |
ascendingFunc(SFunction<T,Object>... fieldNames)
为给定字段的升序索引创建索引键。
|
static org.bson.conversions.Bson |
compoundIndex(org.bson.conversions.Bson... indexes)
创建复合索引详述。
|
static org.bson.conversions.Bson |
compoundIndex(List<? extends org.bson.conversions.Bson> indexes)
复合多指标规格。
|
static org.bson.conversions.Bson |
descending(List<String> fieldNames)
为给定字段的降序索引创建索引键。
|
static org.bson.conversions.Bson |
descending(String... fieldNames)
为给定字段的降序索引创建索引键。
|
static <T> org.bson.conversions.Bson |
descendingFunc(List<SFunction<T,Object>> fieldNames)
为给定字段的降序索引创建索引键。
|
static <T> org.bson.conversions.Bson |
descendingFunc(SFunction<T,Object>... fieldNames)
为给定字段的降序索引创建索引键。
|
static <T> org.bson.conversions.Bson |
geo2d(SFunction<T,Object> fieldName)
在给定字段上为 2d 索引创建索引键。
|
static org.bson.conversions.Bson |
geo2d(String fieldName)
在给定字段上为 2d 索引创建索引键。
|
static org.bson.conversions.Bson |
geo2dsphere(List<String> fieldNames)
在给定字段上为 2dsphere 索引创建索引键。
|
static org.bson.conversions.Bson |
geo2dsphere(String... fieldNames)
在给定字段上为 2dsphere 索引创建索引键。
|
static <T> org.bson.conversions.Bson |
geo2dsphereFunc(List<SFunction<T,Object>> fieldNames)
在给定字段上为 2dsphere 索引创建索引键。
|
static <T> org.bson.conversions.Bson |
geo2dsphereFunc(SFunction<T,Object>... fieldNames)
在给定字段上为 2dsphere 索引创建索引键。
|
static <T> org.bson.conversions.Bson |
geoHaystack(SFunction<T,Object> fieldName,
org.bson.conversions.Bson additional)
已过时。
geoHaystack 在 MongoDB 4.4 中已弃用,首选
geo2dsphere(String...) |
static org.bson.conversions.Bson |
geoHaystack(String fieldName,
org.bson.conversions.Bson additional)
已过时。
geoHaystack 在 MongoDB 4.4 中已弃用,首选
geo2dsphere(String...) |
static <T> org.bson.conversions.Bson |
hashed(SFunction<T,Object> fieldName)
为给定字段上的哈希索引创建索引键。
|
static org.bson.conversions.Bson |
hashed(String fieldName)
为给定字段上的哈希索引创建索引键。
|
static org.bson.conversions.Bson |
text()
为包含字符串数据的每个字段上的文本索引创建索引键。
|
static <T> org.bson.conversions.Bson |
text(SFunction<T,Object> fieldName)
为给定字段上的文本索引创建索引键。
|
static org.bson.conversions.Bson |
text(String fieldName)
为给定字段上的文本索引创建索引键。
|
public static org.bson.conversions.Bson ascending(String... fieldNames)
fieldNames - 字段名称,必须至少包含一个@SafeVarargs public static <T> org.bson.conversions.Bson ascendingFunc(SFunction<T,Object>... fieldNames)
fieldNames - 字段名称,必须至少包含一个public static org.bson.conversions.Bson ascending(List<String> fieldNames)
fieldNames - 字段名称,必须至少包含一个public static <T> org.bson.conversions.Bson ascendingFunc(List<SFunction<T,Object>> fieldNames)
fieldNames - 字段名称,必须至少包含一个public static org.bson.conversions.Bson descending(String... fieldNames)
fieldNames - 字段名称,必须至少包含一个@SafeVarargs public static <T> org.bson.conversions.Bson descendingFunc(SFunction<T,Object>... fieldNames)
fieldNames - 字段名称,必须至少包含一个public static org.bson.conversions.Bson descending(List<String> fieldNames)
fieldNames - 字段名称,必须至少包含一个public static <T> org.bson.conversions.Bson descendingFunc(List<SFunction<T,Object>> fieldNames)
fieldNames - 字段名称,必须至少包含一个public static org.bson.conversions.Bson geo2dsphere(String... fieldNames)
fieldNames - 字段名称,必须至少包含一个public static <T> org.bson.conversions.Bson geo2dsphereFunc(SFunction<T,Object>... fieldNames)
fieldNames - 字段名称,必须至少包含一个public static org.bson.conversions.Bson geo2dsphere(List<String> fieldNames)
fieldNames - 字段名称,必须至少包含一个public static <T> org.bson.conversions.Bson geo2dsphereFunc(List<SFunction<T,Object>> fieldNames)
fieldNames - 字段名称,必须至少包含一个public static org.bson.conversions.Bson geo2d(String fieldName)
注意:二维索引用于在二维平面上存储为点的数据。 2d 索引用于 MongoDB 2.2 及更早版本中使用的旧坐标对。
fieldName - 要在其上创建 2D 索引的字段public static <T> org.bson.conversions.Bson geo2d(SFunction<T,Object> fieldName)
注意:二维索引用于在二维平面上存储为点的数据。 2d 索引用于 MongoDB 2.2 及更早版本中使用的旧坐标对。
fieldName - 要在其上创建 2D 索引的字段@Deprecated public static org.bson.conversions.Bson geoHaystack(String fieldName, org.bson.conversions.Bson additional)
geo2dsphere(String...)注意:对于使用球形几何图形的查询,2dsphere 索引是比大海捞针索引更好的选择。 2dsphere 索引允许字段重新排序;geoHaystack 索引要求第一个字段是位置字段。此外,geoHaystack 索引只能通过命令使用,因此始终一次返回所有结果。
fieldName - 要在其上创建 geoHaystack 索引的字段additional - 构成 geoHaystack 索引键的附加字段@Deprecated public static <T> org.bson.conversions.Bson geoHaystack(SFunction<T,Object> fieldName, org.bson.conversions.Bson additional)
geo2dsphere(String...)注意:对于使用球形几何图形的查询,2dsphere 索引是比大海捞针索引更好的选择。 2dsphere 索引允许字段重新排序;geoHaystack 索引要求第一个字段是位置字段。此外,geoHaystack 索引只能通过命令使用,因此始终一次返回所有结果。
fieldName - 要在其上创建 geoHaystack 索引的字段additional - 构成 geoHaystack 索引键的附加字段public static org.bson.conversions.Bson text(String fieldName)
fieldName - 要在其上创建文本索引的字段public static <T> org.bson.conversions.Bson text(SFunction<T,Object> fieldName)
fieldName - 要在其上创建文本索引的字段public static org.bson.conversions.Bson text()
public static org.bson.conversions.Bson hashed(String fieldName)
fieldName - 要在其上创建哈希索引的字段public static <T> org.bson.conversions.Bson hashed(SFunction<T,Object> fieldName)
fieldName - 要在其上创建哈希索引的字段public static org.bson.conversions.Bson compoundIndex(org.bson.conversions.Bson... indexes)
indexes - 索引规格public static org.bson.conversions.Bson compoundIndex(List<? extends org.bson.conversions.Bson> indexes)
indexes - 索引规格Copyright © 2023. All rights reserved.