你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

CompositePath 类

public class CompositePath extends JsonSerializable

表示 Azure Cosmos DB 数据库服务中 IndexingPolicy 的复合路径。 复合路径用于复合索引。 例如,如果要运行“SELECT * FROM c ORDER BY c.age, c.height”之类的查询,则需要将“/age”和“/height”添加为复合索引的复合路径。

构造函数摘要

构造函数 说明
CompositePath()

构造函数。

CompositePath(String jsonString)

构造函数。

方法摘要

修饰符和类型 方法和描述
CompositePathSortOrder getOrder()

获取复合路径的排序顺序。

例如,如果要运行查询“SELECT * FROM c ORDER BY c.age asc, c.height desc”,则需要将顺序设置为“/age”“ascending”和“/height”“descending”的顺序。

String getPath()

获取路径。

void setOrder(CompositePathSortOrder order)

获取复合路径的排序顺序。

例如,如果要运行查询“SELECT * FROM c ORDER BY c.age asc, c.height desc”,则需要将顺序设置为“/age”“ascending”和“/height”“descending”的顺序。

void setPath(String path)

设置路径。

继承成员

构造函数详细信息

CompositePath

public CompositePath()

构造函数。

CompositePath

public CompositePath(String jsonString)

构造函数。

Parameters:

jsonString - 表示包含的路径的 json 字符串。

方法详细信息

getOrder

public CompositePathSortOrder getOrder()

获取复合路径的排序顺序。

例如,如果要运行查询“SELECT * FROM c ORDER BY c.age asc, c.height desc”,则需要将顺序设置为“/age”“ascending”和“/height”“descending”的顺序。

Returns:

排序顺序。

getPath

public String getPath()

获取路径。

Returns:

路径。

setOrder

public void setOrder(CompositePathSortOrder order)

获取复合路径的排序顺序。

例如,如果要运行查询“SELECT * FROM c ORDER BY c.age asc, c.height desc”,则需要将顺序设置为“/age”“ascending”和“/height”“descending”的顺序。

Parameters:

order - 排序顺序。

setPath

public void setPath(String path)

设置路径。

Parameters:

path - 路径。

适用于