0
我這樣定義如何使子文件獨特
{
'info' : {
'type' : 'dict',
'unique' : True,
'schema' : {
'propertyA' : {'type':'string'},
'propertyB' : {'type':'string'},
'propertyC' : {'type':'string'}
}
},
'others' : {'type':'string'}
}
架構之後,我發佈了以下文件兩次,第一次返回OK,而第二次則返回「不是唯一的錯誤」。
[
{
"info" : {
"propertyA" : "a",
"propertyB" : "b",
"propertyC" : "c"
},
"others" : "other things"
}
]
但是當我發佈一個文檔列表如下:
[
{
"info" : {
"propertyA" : "a",
"propertyB" : "b",
"propertyC" : "c"
},
"others" : "other things"
},
{
"info" : {
"propertyA" : "a",
"propertyB" : "b",
"propertyC" : "c"
},
"others" : "other things"
}
]
兩個文件插入到數據庫中。
爲什麼他們有不同的結果?