DocumentDB:指定的数据类型值 'Point' 无效。
DocumentDB: The specified data type value 'Point' is invalid.
在 DocumentClient.ReplaceDocumentCollectionAsync()
上出现以下异常:
Message: {"Errors":["The specified data type value 'Point' is invalid. Please choose between 'String' and 'Number' data types."]}
代码:
collection.IndexingPolicy.IncludedPaths.Add(new IncludedPath
{
Path = "/*",
Indexes = new System.Collections.ObjectModel.Collection<Index>
{
new RangeIndex(DataType.String) { Precision = -1 },
new RangeIndex(DataType.Number) { Precision = -1 },
new RangeIndex(DataType.Point)
}
});
Client.ReplaceDocumentCollectionAsync(collection).Wait();
使用 Microsoft.Azure.DocumentDB
1.5.0.
您似乎正在尝试设置空间索引。
尝试替换:
new RangeIndex(DataType.Point)
和
new SpatialIndex(DataType.Point)
在 DocumentClient.ReplaceDocumentCollectionAsync()
上出现以下异常:
Message: {"Errors":["The specified data type value 'Point' is invalid. Please choose between 'String' and 'Number' data types."]}
代码:
collection.IndexingPolicy.IncludedPaths.Add(new IncludedPath
{
Path = "/*",
Indexes = new System.Collections.ObjectModel.Collection<Index>
{
new RangeIndex(DataType.String) { Precision = -1 },
new RangeIndex(DataType.Number) { Precision = -1 },
new RangeIndex(DataType.Point)
}
});
Client.ReplaceDocumentCollectionAsync(collection).Wait();
使用 Microsoft.Azure.DocumentDB
1.5.0.
您似乎正在尝试设置空间索引。
尝试替换:
new RangeIndex(DataType.Point)
和
new SpatialIndex(DataType.Point)