在DocumentDb中,我应该如何对它进行分区?我应该使用partitionkey吗?我认为自收集之后我无法做到“/ address/state”......或者我能吗? 我应该使用“/ Id”还是“/ name”?是因为id是由documentDB生成的Guid,并且名称几乎总是唯一的,所以这些主要是独一无二的。那么我应该使用哪一个?我想我可能会按名称查询,但我认为partitionkey应该是可以分组的文档,例如州或城市或parentId。documentDB的分区键或无分区键
我应该不使用partitionKey吗?这适用于documentDb中的我的AspNetuser模式用户表。我应该为partitionKey使用哪个属性?
public class Business
{
[JsonProperty(PropertyName = "id")]
public string Id { get; set; }
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }
[JsonProperty(PropertyName = "description")]
public string Description{ get; set; }
[JsonProperty(PropertyName = "addresses")]
public List<Address> Addresses{ get; set; }
//more columns...
}
public class Address
{
[JsonProperty(PropertyName = "street")]
public string Street{ get; set; }
[JsonProperty(PropertyName = "city")]
public string City{ get; set; }
[JsonProperty(PropertyName = "state")]
public string State{ get; set; }
}
当业务可能有多个地址时,“/ address/state”将如何工作?它不会像“/ address [0]/state”吗?如果我没有嵌入位置,但将它作为一个单独的集合,MS支持告诉我使用'/ state'作为分区键集合。组合越小越好。 – wil