4
我试图将范围索引添加到Azure DocumentDB集合中的特定属性,如this文章中所述。当执行我的代码来创建集合我得到以下错误:将范围索引添加到Azure DocumentDB集合时出现异常
The special mandatory indexing path \\"\/\\" is not provided in any of the path type sets. Please provide this path in one of the sets.
我使用创建集合的代码是:
var collection = new DocumentCollection { id = "myCollectionID" };
collection.IndexingPolicy.IncludedPaths.Add(new IndexingPath
{
IndexType = IndexType.Range,
Path = "/\"TimeStamp\"/\"Epoch\"/?",
NumericPrecision = 7
});
this._client.CreateDocumentCollectionAsync(database.SelfLink, collection);
代码工作,如果我设置的路径该索引简单地为“/”,但我更愿意能够在特定属性上创建索引。我究竟做错了什么?
最近发布的版本有这个改变吗?我无法使用IndexingPath或IndexType,因为它们被列为“内部”。我能够使用IncludePath类来完成此操作。 –
是的,最近这个语法已经改变了。 –