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類來完成此操作。 –
是的,最近這個語法已經改變了。 –